Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
andifreed wants to merge 2 commits into
caldwell:master from
andifreed:work-idref
Open

feat: handle id/ref in json #35 #36
andifreed wants to merge 2 commits into
caldwell:master from
andifreed:work-idref

Conversation

@andifreed

@andifreed andifreed commented Jul 14, 2019

Copy link
Copy Markdown

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.

@yeshvantbhavnasi yeshvantbhavnasi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

changes looks good.

Copy link
Copy Markdown
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

Reviewers

1 more reviewer

@yeshvantbhavnasi yeshvantbhavnasi yeshvantbhavnasi approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /