protoc-gen-openapi: remove duplicate body params #444
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_Body
suffix.fixes #323
The only code that I modified was the
cmd/protoc-gen-openapi/generator/generator.go
file. The rest of the changes were autogenerated by the tests (setting theGENERATE_FIXTURES = true
) or by runningmake all test
.