Skip to content
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

I updated the base URI and included a Draft-specific info box section #673

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion pages/understanding-json-schema/structuring.md
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ example bundled into a Compound Schema Document.

"$defs": {
"address": {
"$id": "/schemas/address",
"$id": "https://example.com/schemas/customer",
"$schema": "http://json-schema.org/draft-07/schema#",

"type": "object",
Expand Down Expand Up @@ -565,3 +565,10 @@ In Draft 4-7, a subschema `$id` is just a base URI change and not
only allowed at the root of a Schema Resource, all schemas bundled
using subschema `$id` must use the same dialect.
</Infobox>

<Infobox label="Draft-specific info">
In Draft 2020-12,`$id` support for changing dialects in an embedded schema
(using $schema with a different value than the parent schema) was added.
In 2020-09, Only URI-references without fragments are allowed;
all other fragments in $id had undefined behavior previously.
Comment on lines +572 to +573
Copy link
Member

Choose a reason for hiding this comment

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

We didn't discuss adding this and I'm not sure it belongs. This doesn't really address a change in behavior. This references something that was syntactically possible previously, but was entirely meaningless. The change was to forbid this syntax that didn't have any meaning anyway. For a reference at this level, I think this is a detail that's unnecessary to call out. It's fixing an inconsistency in the spec. I don't think users care about that.

Someone let me know if I'm missing something and there's a reason why this should be in UJS.

Copy link
Author

Choose a reason for hiding this comment

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

Yes, I thought of adding it because I was trying to show the difference between Draft 2020-12 and 2020-9, but I can remove it @jdesrosiers

Copy link
Member

Choose a reason for hiding this comment

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

Yes, please remove it

</Infobox>