-
Notifications
You must be signed in to change notification settings - Fork 289
Support schemas with array of types #1017
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
Conversation
Visit the preview URL for this PR (updated for commit 1a68f26):
https://docusaurus-openapi-36b86--pr1017-4gdj0s5q.web.app
(expires 2024年12月08日 16:35:37 GMT)
🔥 via Firebase Hosting GitHub Action 🌎
Sign: bf293780ee827f578864d92193b8c2866acd459f
Hi @MarcL01, thanks for the PR. I think this is only officially supported in OpenAPI 3.1, according to the spec? How do you see this interacting with nullable or OpenAPI 3.0 in general?
@sserrata OpenAPI 3.1 actually removes nullable (from 3.0) entirely - see https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0 -> "Swap nullable type for arrays".
This PR is good but we also need to add support for it in anyOf, allOf, oneOf, etc, as well in the type definitions.
Uh oh!
There was an error while loading. Please reload this page.
Description
Support an array of schema types (IE string & null)
Motivation and Context
How Has This Been Tested?
Used the pet store demo to test - http://localhost:3000/petstore_versioned/1.0.0/update-pet-with-form
Before the above schemas would result in
stringnull, now they result instring | nullScreenshots (if appropriate)
Before:
Screenshot 2024年11月07日 at 1 14 30 PM
After:
Screenshot 2024年11月07日 at 12 54 41 PM
Types of changes
Checklist