-
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
OASv3.1 Schema #2474
OASv3.1 Schema #2474
Conversation
e1de2cd
to
d60384b
Compare
dae1f10
to
59b190a
Compare
@philsturgeon maybe this will help, I've updated |
Co-authored-by: Jason Desrosiers <jdesrosi@gmail.com>
Schema: | ||
$anchor: Schema | ||
oneOf: | ||
- $ref: '#Reference' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- $ref: '#Reference' |
This reference is redundant, as a draft2020-12 schema will of course accept the $ref keyword itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(this is no longer redundant if the '#Reference' definition is extended to include 'summary' and 'description' properties and "unevaluated: false".)
$anchor: Schema | ||
oneOf: | ||
- $ref: '#Reference' | ||
- type: object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it intentional that boolean schemas are excluded at this level?
properties: | ||
scheme: | ||
type: string | ||
oneOf: | ||
- properties: | ||
type: | ||
const: http | ||
- properties: | ||
type: | ||
const: bearer | ||
bearerFormat: | ||
type: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part doesn't look right to me. The logic is supposed to be
if
scheme
(nottype
!) ="bearer"
thenbearerFormat
may be present
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#fixed-fields-23
Something like:
properties: | |
scheme: | |
type: string | |
oneOf: | |
- properties: | |
type: | |
const: http | |
- properties: | |
type: | |
const: bearer | |
bearerFormat: | |
type: string | |
properties: | |
type: | |
const: http | |
scheme: | |
type: string | |
if: | |
properties: | |
scheme: | |
const: bearer | |
then: | |
properties: | |
bearerFormat: | |
type: string |
I created a new PR at #2489 so we can make progress while @philsturgeon is busy planting trees. All of the comments and suggestions that have been posted here have been incorporated into the new PR. |
Co-authored-by: Karen Etheridge <ether@cpan.org> Co-authored-by: Helen Kosova <hkosova@users.noreply.github.com>
Co-authored-by: Helen Kosova <hkosova@users.noreply.github.com> Co-authored-by: Jason Desrosiers <jdesrosi@gmail.com>
Co-authored-by: Karen Etheridge <ether@cpan.org>
Ha! Sorry, I just merged all the things but you beat me to it. Brilliant, take it away! |
Superseded by #2489.
Closes #2314.
Adding a JSON Schema for the whole OpenAPI v3.1 document, as plenty of tooling requires this before they can upgrade to OpenAPI v3.1.
This is based on a gist from @handrews, and is being tweaked for OpenAPI v3.1. https://gist.github.com/handrews/6dfebd56ef97328f9e4dc7a47a1e8bc7
This is different to the OpenAPI dialect/metaschema work being done first in #2016 but is starting again in another yet unmade PR.