V2 Fix swag generating "oneOf" blocks for both form types#2157
Open
V2 Fix swag generating "oneOf" blocks for both form types#2157
Conversation
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.
Describe the PR
Currently v2 branch has an issue with the generation of x-www-form-urlencoded and multipart/form-data schemas. For some reason, when generating the yaml and json for the swagger files, it is decided that if you have multiple
//@Paramcomments then they all get bundled into a singleoneOfstatement which is not supposed to happen. For both forms they should look something like the following:Above comments correctly generates the below yaml:
Above x-www-form-urlencoded form correctly produces the following yaml:
Relation issue
Issue 242
Issue 2086
Both of the above issues are related to this. I didn't have time to test and see if this also fixed the json body issues that they were having but I know it at least works for the issues I have described.
PR 2131 also seems to fix the
//@Acceptissue so if that gets merged in first then I can remove it from this PR as wellAdditional context
Go version: 1.25.8
Swag Version: 2.0.0 (Commit 8c7a6f6)
Please let me know if there is anything I should change to help get this merged in soon. Thanks for making this project!