json-schema-spec
json-schema-spec copied to clipboard
`$id` updates
What kind of change does this PR introduce?
Cleans up some language around $id.
Issue & Discussion References
- Related to #1444
- Related to #1349
Summary
Just some clean-up and clarification that we've previously identified.
Schema document roots SHOULD have an $id (maybe relax this? ...) - from https://github.com/json-schema-org/json-schema-spec/issues/1444#issuecomment-1749604538
I decided to leave this in for now. We can discuss and change separately if needed.
Does this PR introduce a breaking change?
No
@notEthan @jdesrosiers I've almost completely reworked the $id section. There were some redundancies in it that didn't sit right with me.
I moved the syntactic definition of the keyword up to the top sentence next to its purpose, and I reworked how it talks about defining a resource, needing to be resolved against the current base IRI, and then providing a base IRI for child resources.
This relationship is necessarily recursive (the $id value needs a base IRI but then also serves as a base IRI), so it's quite difficult to state simply.
@jdesrosiers this should be done now.