protoc-gen-openapi: remove duplicate body params#444
Open
jagobagascon wants to merge 1 commit intogoogle:mainfrom
Open
protoc-gen-openapi: remove duplicate body params#444jagobagascon wants to merge 1 commit intogoogle:mainfrom
jagobagascon wants to merge 1 commit intogoogle:mainfrom
Conversation
e707445 to
f32e5e9
Compare
f32e5e9 to
da89488
Compare
When a request has both path parameters and body = "*", the path parameters were being repeated in the body. But according to the docs: the special name `*` is used to define that every field not bound by the path template should be mapped to the request body. This commit does exactly that, when the body is `*` and there are some path parameters, then the a new message schema is created that does not include the path parameters. The name of the schema is the same as the message name, with the `_Body` suffix. fixes google#323
da89488 to
96fb53b
Compare
Author
|
It looks like yesterday's |
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.
When a request has both path parameters and body = "*", the path parameters were being repeated in the body. But according to the docs: the special name
*is used to define that every field not bound by the path template should be mapped to the request body.This commit does exactly that, when the body is
*and there are some path parameters, then the a new message schema is created that does not include the path parameters. The name of the schema is the same as the message name, with the_Bodysuffix.fixes #323
The only code that I modified was the
cmd/protoc-gen-openapi/generator/generator.gofile. The rest of the changes were autogenerated by the tests (setting theGENERATE_FIXTURES = true) or by runningmake all test.