Skip to content

Common approaches to linking instance data with schemas? #662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
stefangotz opened this issue Oct 10, 2018 · 2 comments
Closed

Common approaches to linking instance data with schemas? #662

stefangotz opened this issue Oct 10, 2018 · 2 comments

Comments

@stefangotz
Copy link

Hi!

I've read through #601 and #660, but I'm still unsure what common practices there are to indicate in instance data which schema the instance data should be validated against. In my application, there is no side channel and no external ad-hoc knowledge about the 'type' of instance data. I understand that JSON schema itself not prescribe any particular mechanism to do this, but I wonder what other people are doing to achieve this?

Cheers - Stefan

@anatoli26
Copy link

It is explained in the 2nd issue you mention in the 2nd comment: #660 (comment). TL;DR: you put among the headers of the JSON instance document: Link: <http://example.com/my-hyper-schema#>; rel="describedby". If you can't specify a header, then check the 5th comment: #660 (comment).

@stefangotz
Copy link
Author

Cool, thanks @anatoli26 !

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

No branches or pull requests

2 participants