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

Figuring out $ref and $id in OAS v3.1 in general #2100

Closed
philsturgeon opened this issue Jan 10, 2020 · 1 comment
Closed

Figuring out $ref and $id in OAS v3.1 in general #2100

philsturgeon opened this issue Jan 10, 2020 · 1 comment

Comments

@philsturgeon
Copy link
Contributor

@darrelmiller

Is it expected that two distinct OAS Schema Objects would be able to refer to each other using canonical Ids?

yes

If the above example is possible, then is it also expected that $ref objects in other parts of the OAS document can use the canonical Id?

yes

This example uses the standard OAS way of referencing a component. However, it ignores the fact that $Id has been defined. I am guessing that this is still fine.

More or less. Technically, if the OpenAPI document were considered a JSON Schema, then the behavior is undefined. But particularly for landing directly on the schema object with an $id, I suspect in practice most implementations will support it. It was (or ambiguously appeared to be) required in the last few drafts.

Also, I think it would be fine if OAS had its own rules for things directly under /components/schemas. Although I guess that would actually be more complicated for tooling vendors.

Originally posted by @handrews in #1977 (comment)

@philsturgeon
Copy link
Contributor Author

Duplicate of #2092

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

No branches or pull requests

1 participant