Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unusual JSON schemas #126

Open
julienrf opened this issue Nov 7, 2017 · 0 comments
Open

Unusual JSON schemas #126

julienrf opened this issue Nov 7, 2017 · 0 comments

Comments

@julienrf
Copy link

julienrf commented Nov 7, 2017

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"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant