JSON references

Is there a standard way of referencing objects by identity in JSON? For example, so that graphs and other data structures with lots of (possibly circular) references can be sanely serialized/loaded?

From: JSON: Standard way of referencing an object by identity (for, eg, circular references)? – Stack Overflow

Then there’s an expired yet interesting Internet-Draft used in JSON Schema and Swagger and a Python module giving us this example:

{
“foo”: {“$ref”: “#/bar”},
“bar”: true
}

that would be resolved as:

{
  "foo": true,
  "bar": true
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.