-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Open
Labels
Description
I have a field in a protobuf message called "parent". It looks like this:
message ListRolesRequest {
// The resource name of the parent resource in one of the following formats:
// `` (empty string) -- this refers to curated roles.
// `organizations/{organization_id}`
// `tenants/{tenant_id}`
string parent = 1;
...
}
And a gRPC method that looks like this:
rpc ListRoles(ListRolesRequest) returns (ListRolesResponse) {
option (google.api.http) = {
get: "/auth/iam/roles"
additional_bindings {
get: "/auth/iam/{parent=organizations/*}/roles"
}
additional_bindings {
get: "/auth/iam/{parent=tenants/*}/roles"
}
};
}
The parent can take the form organizations/<org_id>
or tenants/<tenant_id>
or it can be empty. I'd like the generated swagger definitions to match all three. For example:
GET /auth/iam/roles
GET /auth/iam/organizations/<org_id>/roles
GET /auth/iam/tenants/<tenant_id>/roles
The swagger generator currently only generates two paths:
GET /auth/iam/roles
GET /auth/iam/{parent}/roles
{parent}
only matches a single path parameter, and since the parent can include a slash you can't get a match.
What's the correct way of doing this?
frolickingferret445, timonwong, a631807682, oyvindwe, JigarJoshi and 1 more