Open HoaiDang-work opened 2 weeks ago
Thanks for your detailed bug report. This sounds like a reasonable bug, I expect the logic for parsing the path parameters and marking them required doesn't take this annotation into account. Would you be willing to help contribute a fix? The logic for this is in here: https://github.com/grpc-ecosystem/grpc-gateway/blob/main/protoc-gen-openapiv2/internal/genopenapi/template.go.
I'm not familiar with Golang to contribute quality code to fix the problem 😓
🐛 Bug Report
We have the below proto description with openAPI annotations.
FederatedIdentity identity = 4 [(google.api.field_behavior) = REQUIRED];
is request body param which is required. However, part of theidentity
, thetype
field is also path param/v1/identity/{identity.type}/register-by-link/cancel
In the generated openapi spec, the identity is not marked as required.
Expected behavior
The remaining parts of identity should be marked as required.
Actual Behavior
Only the part including in the path param is marked as required, the remaining parts as request body params are not marked as required.
Your Environment
MacOS M1