Open Bug 1948821 Opened 1 month ago Updated 1 month ago

Add support / link for JSON Reference

Categories

(DevTools :: JSON Viewer, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: nchevobbe, Unassigned)

Details

The JSON spec specify a way to have references in the JSON file: https://json-spec.readthedocs.io/reference.html
On such reference, it would be nice to add a "jump to" button that would select the referenced value

Thanks for filing the bug Nicolas!

On top of having a link, do you think we could allow the user to keep exploring / expanding the reference from the spot where it was detected.
Same behavior as when you explore an object in the console basically.

This would avoid having to constantly jump to different locations in the file. We would still need to surface that there is a link somehow, so that saving as RAW JSON doesn't give too surprising results.

[a little tour of JSON related specifications]

To be fair against the true "JSON specification", which was originaly published on https://www.json.org/
and later translated into an actual RFC https://datatracker.ietf.org/doc/html/rfc8259
only specifies the basic JSON objects that JavaScript JSON API supports.

https://json-spec.readthedocs.io/reference.html
comes from:
https://github.com/johnnoone/json-spec
Whose title is misleading. It is a set of tools implementing various other actual specifications.

The interesting specification is JSON Reference, and especially its resolution section:
https://datatracker.ietf.org/doc/html/draft-pbryan-zyp-json-ref-03#section-4
which describes "$ref", which can be an URL, but also be a json pointer for same-file resolution.
And JSON Pointers:
https://datatracker.ietf.org/doc/html/rfc6901
which describes pointers, which are kind of xpath for json objects.

Note that while JSON Pointers is an RFC, JSON Reference is an obsolete draft from 2013.
I couldn't find anything more tangible around JSON Reference.

You need to log in before you can comment on or make changes to this bug.