Support schemas with array of types#1017
Merged
sserrata merged 2 commits intoPaloAltoNetworks:mainfrom Nov 8, 2024
Merged
Conversation
|
Visit the preview URL for this PR (updated for commit 1a68f26): https://docusaurus-openapi-36b86--pr1017-4gdj0s5q.web.app (expires Sun, 08 Dec 2024 16:35:37 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: bf293780ee827f578864d92193b8c2866acd459f |
Member
|
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 |
sserrata
approved these changes
Nov 8, 2024
Contributor
|
@sserrata OpenAPI 3.1 actually removes This PR is good but we also need to add support for it in anyOf, allOf, oneOf, etc, as well in the type definitions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:

After:

Types of changes
Checklist