Unusual JSON schemas

Open
#126 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
json, python
Domain
api, backend

Research direction

Start by reviewing the XQueue endpoint responses and any existing schema or API documentation. Confirm which entities currently contain JSON-encoded strings, then document or implement the agreed response shape and verify the compatibility impact of replacing those strings with objects.

Written by the indexing model from the issue text.

Description

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"
  }
}
Dominant language
Python
Stars
39
Forks
102
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openedx/xqueue

All issues in openedx/xqueue

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.