Open istvan-hevele opened 2 years ago
cc @timburks
I also find that quite confusing. Is there an opinion on this from the developers? Thanks!
Hello everyone,
I also encountered this problem when switching from protoc-gen-openapiv2 to gnostic. Fully mapped bodies are the core element used to define custom methods within Google's AIP guidelines.
Would it be possible to reprioritize this issue and evaluate istvan-hevele's PR in this regard?
Thank you
I came across this exact problem and added my own PR to fix it: https://github.com/google/gnostic/pull/444
When a request has both path parameters and
body: "*"
, the path parameters are being repeated in the body in the resulting OpenAPI spec. Note how the following example hasname
both inparameters
andrequestBody
in the generated openapi spec.protobuf:
openapi spec:
According to use_wildcard_in_body, every field not bound by the path template should be mapped to the request body. So fields that are bound by the path template shouldn't be in the request body.
Proposal: In these cases, create a new schema named
{method_name}RequestBody
which doesn't contain the fields bound by the path:There's a PR on my fork that implements this proposal: https://github.com/istvan-hevele/gnostic/pull/1