Prevent crash in createExample when a multi variant type is being parsed. All variants are concatinated with '|'. Also added a "null" type wich is not the """null""" type, made sure to extra check against this.#267
Open
brymko wants to merge 3 commits intocloud-annotations:mainfrom
Conversation
…sed. All variants are concatinated with '|'. Also added a "null" type wich is not the """null""" type, made sure to extra check against this.
✅ Deploy Preview for docusaurus-openapi ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Author
|
Im not sure if my default assumption of concating everyting with "|" together holds. Because this is only an example maybe we only want the first element ?| As an example, this would be generated with the proposed changes: curl -L -X GET 'some_path'' \
-H 'Content-Type: application/json' \
-H 'Accept: text/plain; charset=utf-8' \
-d '{
"is_active": "true | null",
}Now this would obviously be rejected by the server, but so would all context aware data. And given that this should only server as a default i think it might be fine. Open for thoughts. |
Member
|
Is this valid OpenAPI? I would expect the spec to look something like this: |
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.
While running this project on our API generated OAPI spec i found it to be crashing when running into variant types. For instance incase there is an optional field:
This merge is forwarding my local fix