Skip to content

Conversation

@andifreed
Copy link

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.

Copy link

@yeshvantbhavnasi yeshvantbhavnasi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes looks good.

@andifreed
Copy link
Author

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").

it weird that Object.create did not copy the attributes
but this produced the desired results.
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

Successfully merging this pull request may close these issues.

2 participants