Skip to content

fix/extension versions#111

Open
baywet wants to merge 4 commits into
OAI:mainfrom
baywet:fix/extension-versions
Open

fix/extension versions#111
baywet wants to merge 4 commits into
OAI:mainfrom
baywet:fix/extension-versions

Conversation

@baywet

@baywet baywet commented Jul 8, 2026

Copy link
Copy Markdown
Member

follow up to #102, #98, #88, #86, #84

@baywet baywet requested a review from a team as a code owner July 8, 2026 15:11
@baywet baywet self-assigned this Jul 8, 2026
Comment on lines +14 to +15
Use this extension only with JSON Schema versions before 2019-09; 2019-09 and later define [`$anchor`](https://json-schema.org/draft/2019-09/json-schema-core#anchor) directly.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is only truly needed in OAS 3.0 schemas. Prior to the introduction of $anchor: foo, earlier drafts could achieve the same thing with $id: "#foo" (post-draft-04) or id: "#foo" (draft-04).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

but wouldn't doing so be "confusing" for mechanical conversions?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@baywet what is the scenario that leads to this being relevant for anything other than OAS 3.0? 3.1+ defaualt to draft 2020-12, and at least so far, by definition that means there are no unsupported keywords to worry about.

OAS 3.0 doesn't use a standard JSON Schema draft, much less allow you to switch them, so there's no point talking about those for OAS 3.0.

We don't want to encourage using any prefix outside of OAS 3.0. For OAS 3.1+, it should be completely unnecessary. For JSON Schema outside of OAS, it would go against how such things are handled there, and create a retroactively-inserted pseudo-standard.

The best thing to do here is advise that these are used only with OAS 3.0.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think I misunderstood the previous comment. I thought you wanted me to add some kind of guidance about using $id/id for earlier versions? But instead you simply want to add the OpenAPI version this is relevant?

Comment thread registries/_extension/x-jsonschema-contentEncoding.md Outdated
Comment thread registries/_extension/x-jsonschema-contentMediaType.md Outdated
Co-authored-by: Vincent Biret <vincentbiret@hotmail.com>

@mikekistler mikekistler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. 👍

Comment thread registries/_extension/x-jsonschema-contentMediaType.md Outdated
Co-authored-by: Mike Kistler <mkistler82@gmail.com>
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

Successfully merging this pull request may close these issues.

3 participants