-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
CollectionFormat multi for query params of repeated fields 2 #909
CollectionFormat multi for query params of repeated fields 2 #909
Conversation
Solves grpc-ecosystem#756 . Also formats protoc-gen-swagger/genswagger/template_test.go according to go fmt.
Codecov Report
@@ Coverage Diff @@
## master #909 +/- ##
=========================================
- Coverage 53.52% 53.5% -0.03%
=========================================
Files 40 40
Lines 3959 3957 -2
=========================================
- Hits 2119 2117 -2
Misses 1642 1642
Partials 198 198
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick turnaround on this @bmperrea, fantastic work! I can see you added a test case for repeated enums, will that cover the bug that was introduced?
1990b43
to
cc0d6af
Compare
@johanbrandhorst - that queryParams test case was in the previous PR as well. But to your point, I just added another commit that adds stricter (and cleaner)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!
@mmarod @c2nc I've merged this to master, could you both confirm this is still working for you before I make a release? |
@johanbrandhorst I can check in a few hours |
Looks good to me @johanbrandhorst -- and nice job @bmperrea |
Thanks for confirming @mmarod, I will make another release. |
…osystem#909) * Use collectionFormat multi for query params of repeated fields Fixes grpc-ecosystem#756 . Also formats protoc-gen-swagger/genswagger/template_test.go according to go fmt. * regenerate the files * only specify multi in the method queryParams Fixes grpc-ecosystem#906. * deep equal checks in TestSchemaOfField
This fixes the issues introduced in #902 , reverted in #907 , to solve #756 . The issue was that we were adding
collectionFormat
in all calls to the functionschemaOfField
not only inqueryParams
.For reference the last commit in this branch is the diff from #902 , which includes the removal of several
collectionFormat: multi
lines. I have confirmed using the live demo of swagger editor that those lines inresponse_body_service
indeed make the swagger "Structural errors" against the spec. The new generated examples appear to follow the spec according to that tool.