Skip to content

Instantly share code, notes, and snippets.

@nikclayton
Created February 27, 2024 22:56
Show Gist options
  • Save nikclayton/ebba4c76261b377094d31fe72f503ec9 to your computer and use it in GitHub Desktop.
Save nikclayton/ebba4c76261b377094d31fe72f503ec9 to your computer and use it in GitHub Desktop.

There's some weird stuff in some server responses to /api/v1/instance and /api/v2/instance.

Here's some I've seen in the wild. Format is:

  • Heading with server type (e.g., "akkoma") and whether this was v1 or v2
  • Then the error when trying to parse the data
  • Then a list of all the servers that triggered the same parse error, with their reported version number

Some of these have been fixed in newer versions of the servers but the fixes haven't fully rolled out.

Weirdness includes:

  • Servers with absurdly high limits for content (length of posts, poll expiration times, etc)
  • Mandatory configuration data that is missing
  • Servers lying about their subscribers (e.g., mastodon.adtension.com's admin account reports they have 97,000,000,048 followers)

To head off a potential de-rail along the lines of "This is JSON, you need to validate this data before you use it". Yes, I know, that's how I gathered this data in the first place.

[All the "Expected an int" messages would be better phrased as "Expected something that fits in 31 bits"]


Processed 26028 entries

akkoma: v1.json

Expected an int but was 9999999999999 at path $.max_toot_chars

Expected an int but was 999999999999999 at path $.max_toot_chars

Expected an int but was 3.1536e22 at path $.poll_limits.max_expiration

Expected an int but was 6900000000000000000 at path $.max_toot_chars

Expected an int but was 3153600000 at path $.poll_limits.max_expiration

Expected an int but was 3155760000 at path $.poll_limits.max_expiration

Expected an int but was NULL at path $.configuration.statuses.max_media_attachments

akkoma: v2.json

Expected BEGIN_OBJECT but was BOOLEAN at path $.registrations

Non-null value 'description' was null at $.description

friendica: v2.json

Expected BEGIN_ARRAY but was BEGIN_OBJECT at path $.configuration.media_attachments.supported_mime_types

Required value 'domain' missing at $

friendica: v1.json

Expected a string but was BEGIN_OBJECT at path $.uri

gotosocial: v1.json

Expected an int but was 4294967296 at path $.configuration.statuses.max_characters

gotosocial: v2.json

Expected an int but was 4294967296 at path $.configuration.statuses.max_characters

mastodon: v2.json

Expected BEGIN_OBJECT but was STRING at path $.thumbnail

Expected an int but was 97000000048 at path $.contact.account.followers_count

Expected an int but was 4294967296 at path $.configuration.statuses.max_characters

mastodon: v1.json

Expected an int but was 4294967296 at path $.max_toot_chars

pleroma: v1.json

Expected an int but was 3155760000 at path $.configuration.polls.max_expiration

Expected an int but was 1099511627776 at path $.configuration.statuses.max_characters

Expected an int but was 1.0e69 at path $.max_toot_chars

Expected an int but was 4.562440617622195e192 at path $.configuration.statuses.max_characters

Expected an int but was 5000000000000000000000000000 at path $.max_toot_chars

Expected an int but was 3.1536e22 at path $.poll_limits.max_expiration

Expected an int but was 8008542069 at path $.max_toot_chars

Expected an int but was NULL at path $.configuration.polls.max_characters_per_option

pleroma: v2.json

Expected an int but was 1099511627776 at path $.configuration.statuses.max_characters

Expected an int but was 4.562440617622195e192 at path $.configuration.statuses.max_characters

Expected BEGIN_OBJECT but was STRING at path $

Expected a long but was 3.1536e22 at path $.configuration.polls.max_expiration

Required value 'id' missing at $.contact.account

Expected an int but was NULL at path $.configuration.polls.max_characters_per_option

Expected BEGIN_OBJECT but was BOOLEAN at path $.registrations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment