Skip to content

Unusual JSON schemas #126

@julienrf

Description

@julienrf

I wonder if there is any documentation for the JSON entities returned by the XQueue endpoints?

So far the best I can do is reverse engineering. I was surprised to see JSON objects embedded in JSON strings. What is the motivation for doing that? The drawbacks of this solution are that:

  • it makes it harder to define a proper JSON schema for these entities (consequently, it makes it impossible to decode these entities with automated solutions based on such schemas),
  • entities have to be parsed several times,
  • entities take more space because they are escaped several times,
  • pretty printing an entity is hopeless.

Why not use plain old JSON objects instead?

To be clearer, I propose that we replace the following schema:

{
  "foo": "{ \"bar\": \"baz\" }"
}

With this one:

{
  "foo": {
    "bar": "baz"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions