-
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
Use $ref to definitions in oneOf for Parameter locations #3258
Conversation
Just to be clear, you're wanting to patch the current OAS schema document in order not to have redundancy in the compliance parser chain? |
@MikeRalphson sorry I did not notice your question when you asked it! It's not so much avoiding redundancy as it is making the tools more user-friendly. I'm perfectly comfortable with JSON Patch (RFC 6902), but it is not incredibly intuitive to read compared to JSON Merge Patch (RFC 7396). For folks wanting to modify |
@OAI/openapi-maintainers one more approval on this and I can merge it 🙏 |
schemas/v3.0/schema.yaml
Outdated
anyOf: | ||
- required: [allOf] | ||
- required: [anyOf] | ||
- required: [oneOf] |
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.
I'm not sure you meant for this to go in this PR, it seems to not fit with the title/description.
If you did: I don't know discriminator
well, but the example Models with Polymorphism Support has discriminator
in /components/schemas/Pet
without a *Of
keyword. But then /components/schemas/Pet
is never used in the example in a way that would invoke discriminator
, so that's confusing.
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.
@notEthan oops- looks like I need to rebase this (there was a whole thing where this got added and then removed), doing so momentarily.
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.
It's rebased but seems to be the same as what I commented on
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.
wat... oh %$@#! I fixed it locally and forgot to add that commit. I'm still not sure how it got there in the first place. Fixed for real now, sorry about that 🤦
f5d888c
to
cc9292c
Compare
I'd like to use a JSON Merge Patch (RFC 7386) document to add keywords for the OAS compliance parser project. JSON Merge Patch does not handle arrays well, so moving these to their own definitions and having the "oneOf" directly in the "Parameter" definition (avoiding duplicate "description" fields on the same instance location) allows merge-patch to work where I need it. Otherwise, JSON Patch (RFC 6902) will be needed, which is less intuitive. The 3.1 schema already uses "$defs" here.
cc9292c
to
136371f
Compare
I'd like to use a JSON Merge Patch (RFC 7386) document to add keywords for the OAS compliance parser project.
JSON Merge Patch does not handle arrays well, so moving these to their own definitions and having the "oneOf" directly in the "Parameter" definition (avoiding duplicate "description" fields on the same instance location) allows merge-patch to work where I need it.
Otherwise, JSON Patch (RFC 6902) will be needed, which is less intuitive.
The 3.1 schema already uses "$defs" here.