-
Notifications
You must be signed in to change notification settings - Fork 278
Add type: "null" downcasting when in oneOf and anyOf for OpenAPI v3
#2645
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
base: support/v2
Are you sure you want to change the base?
Conversation
|
@microsoft-github-policy-service agree |
|
@baywet I've drafted this PR. Let me know what you think. Some parts are a little bit rough imho, for example the update to Edit: I just went ahead and implemented it. I know that I take a risk that this won't be merged or requires significant changes, then I will just see it as an exercise 🙃 |
baywet
left a comment
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.
Thanks for the contribution!
Co-authored-by: Vincent Biret <[email protected]>
…and use JsonNode.DeepEquals in tests Co-authored-by: desjoerd <[email protected]>
Co-authored-by: desjoerd <[email protected]>
Co-authored-by: desjoerd <[email protected]>
Address PR microsoft#2645 review comments: improve type checking logic and use JsonNode.DeepEquals
|
@baywet I've addressed your comments (with copilot so I could go to the movie Zootopia 2 in the meantime 😎, AI let's programming really happen from your phone 😜). Let me know if I need to change something. |
Add
type: "null"downcasting when in oneOf and anyOf for OpenAPI v3Description
This PR adds downcasting of oneOf and anyOf for openapi v3.
When writing OpenAPI v3 it will remove schemas from oneOf and anyOf with
{ "type": "null" }and apply it to the parent asnullable: true. It also tries to find a common overlappingtypewhich will also be applied to the parent schema asnullable: trueis only doing something whentypeis specified.It's between a bug-fix and a feature as the current situation downcasts
{ "type": "null" }to{ "nullable": true }which according to some clarifications of the spec doesn't do anything and tools expect thenullable: trueon the parent schema.Type of Change
Related Issue(s)
Changes Made
type: nullfor OpenAPI v3.Testing
Checklist
Versions applicability