You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the bug report! We've discussed this a bit on other channels and I think there's definitely something we can do here. The case we're interested in is when one of the fields of a oneof appears in a path parameter. In that case, we should be able to deduce that none of the other fields of that oneof can be specified, and so remove them from the parameter list. I don't think we need logic clever enough to produce an OpenAPI oneof, in this case simply two GETs with different parameters should be OK, right?
@johanbrandhorst
Hi, it doesn't seem it's finished yet. Can I work on this?
So making separate endpoints with parameters that are included in each endpoint's path will resolve this, right?
Hi @momom-i, yes, feel free to start work on this :). I think the ask is to ensure that if one of fields in a oneof is specified in the path, none of the other fields should be in the parameters. The specific case of two RPCs as in this example may be something we need to consider separately, afterwards.
amanraja
pushed a commit
to amanraja/grpc-gateway
that referenced
this issue
Oct 6, 2023
Steps you follow to reproduce the error:
With the annotations above, two "separate" endpoints are defined in the output:
With the non-path parameter of the oneof listed as an optional query parameter, which is incorrect:
What did you expect to happen instead:
I expect a single GET endpoint defined with 2 path parameters listed with oneof as required (not both, and nothing listed as a request parameter).
Your answer here.
What's your theory on why it isn't working:
I suspect there is simply no code to deal with the protobuf oneof type.
The text was updated successfully, but these errors were encountered: