-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Allow JSON schema id and $schema in OpenAPI schema definitions #1523
Comments
This issue will be addressed if we can make headway on the alternate schema proposal. Whitelisting certain properties I fear will just open the door to whitelisting "just one more property" and the end result will be confusion as to what tooling supports, ignores and doesn't support. |
@DavidBiesack in the meantime you may be interested in https://github.com/wework/json-schema-to-openapi-schema to help bridge the gap (or something else similar) |
Thanks, @handrews but I don't need to go that direction. I'm designing the schema as part of our OpenAPI. I just want to publish them as full JSON Schema that contains |
any update on this? |
Added in #1977 so we can close this. |
Swagger is a brand, a trademark for a suite of tools. OpenAPI has accepted $id. |
JSON Schema files can contain top-level fields
id
and$schema
. When using$ref
in an OpenAPI document to reference an external schema, the OpenAPI tooling rejects JSON schema files that contain one or both of these fields because 1) the spec does not allow additional fields and thus 2) the published JSON Schema document for OpenAPI does not allow additional fields.See https://github.com/whitlockjc/swagger-lint/issues/11 for some specific examples.
I propose changing the spec and the corresponding OpenAPI 3.0 schema to allow
id
and$ref
so that one can publish OpenAPI model definition as JSON schema documents. This will allow more tools to consume them more fully.Note: I am not requesting OpenAPI change the allowed subset of JSON Schema features.
The text was updated successfully, but these errors were encountered: