-
Couldn't load subscription status.
- Fork 2.4k
Open
Description
Steps you follow to reproduce the error:
rpc GetArticle (GetArticleRequest) returns (GetArticleResponse) { option (google.api.http) = { get: "/v2/articles/{slug}" additional_bindings: { get: "/v2/articles/{id.hex}" } }; } message GetArticleRequest { oneof article_id { insider.protobuf.ObjectID id = 1; string slug = 2; } } With the annotations above, two "separate" endpoints are defined in the output:
/v2/articles/{slug} /v2/articles/{id.hex} With the non-path parameter of the oneof listed as an optional query parameter, which is incorrect:
{ "name": "id.hex", "description": "xyz", "in": "query", "required": false, "type": "string" } 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).
"parameters": [ { "name": "slug", "description": "Article slug.", "in": "path", "required": true, "type": "oneof" }, { "name": "id.hex", "description": "Article ID", "in": "path", "required": true, "type": "oneof" } ] 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.