caldwell / renderjson

Render JSON into collapsible HTML
http://caldwell.github.io/renderjson
418 stars 91 forks source link

feat: handle id/ref in json #35 #36

Open andifreed opened 5 years ago

andifreed commented 5 years ago

This is how we solved the problem with microsofts $id/$ref graph reduction strategy. We basically replaced the objects with $ref with the referenced object. It also permits us to use the same navigation for json schema's id $ref.

andifreed commented 5 years ago

Crap, this isn't quite right, as the json schema example should merge the $ref as there are other properties that are might be there in the supplied example "required" : true.

So need to explore -- can I always merge (dropping the $ref) or only merge if there are unmatched properties (in the schema use case both will have "type" : "object" and match "id" to "$ref").