Repository navigation
V2 Fix swag generating "oneOf" blocks for both form types - #2157
Merged
Merged
Conversation
ubogdan
reviewed
Apr 9, 2026
ubogdan
reviewed
Apr 9, 2026
Contributor
|
@mbd3v let's define some constants , rebase and fix conflicts. |
|
@ubogdan is there something preventing this to be merged and released? |
ryansuhartanto
added a commit
to ryansuhartanto/koda-b8-backend2
that referenced
this pull request
Jul 23, 2026
Issue on multipart/form-data: swaggo/swag#2157
Author
|
sorry for the dealy. I wrote this PR right before finals and kinda forgot about it over the summer. completed the rebase/fixed conflicts and made some constants (as well as added two new tests) |
added 2 commits
August 17, 2026 15:57
mbd3v
force-pushed
the
v2-fix-form-generation
branch
from
August 17, 2026 21:02
889e67e to
4edde01
Compare
ubogdan
approved these changes
Aug 18, 2026
Contributor
|
@mbd3v Thanks for your contribution! |
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!