json-schema-spec icon indicating copy to clipboard operation
json-schema-spec copied to clipboard

`$id` updates

Open gregsdennis opened this issue 1 year ago • 1 comments

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

gregsdennis avatar Oct 01 '24 00:10 gregsdennis

@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.

gregsdennis avatar Oct 11 '24 19:10 gregsdennis

@jdesrosiers this should be done now.

gregsdennis avatar Oct 29 '24 08:10 gregsdennis