Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Have not mentioned id #37

Closed
miloyip opened this issue May 9, 2015 · 2 comments · Fixed by #39
Closed

Have not mentioned id #37

miloyip opened this issue May 9, 2015 · 2 comments · Fixed by #39

Comments

@miloyip
Copy link

miloyip commented May 9, 2015

I found that id was never mentioned in this book. Actually I have difficulties in understanding that part in spec during implementation of a validator. Is there a plan for covering it?

By the way, this book is very useful for me to learn json schema in short time. Thank you.

@miloyip miloyip changed the title Have not mentioned id Have not mentioned id May 9, 2015
@embray
Copy link
Collaborator

embray commented May 12, 2015

Oh, thanks for pointing this out. I double checked and indeed there does not seem to be any reference to it--a glaring omission.

In short, the "id" keyword is just a self-reference for the schema. It should be a URI, preferably where the schema itself can be found, and so it serves as a globally-unique identifier for the schema (which can be used in conjunction with $ref, which also deserves a chapter in the book).

@embray
Copy link
Collaborator

embray commented May 12, 2015

I take it back regarding $ref; it is discussed here: http://spacetelescope.github.io/understanding-json-schema/structuring.html but id is not.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants