protoc-gen-open generates a bad path for some starred paths
- Dominant language
- Go
- Stars
- 2.3k
- Forks
- 279
- PR merge metrics
- No merged PRs in 30d
Description
Given this service definitions:
```
service WorkspaceService {
rpc GetWorkspaceSetting(GetWorkspaceSettingRequest) returns (WorkspaceSetting) {
option (google.api.http) = {get: "/api/v1/{name=workspace/settings/*}"};
option (google.api.method_signature) = "name";
}
message GetWorkspaceSettingRequest {
// The resource name of the workspace setting.
// Format: workspace/settings/{setting}
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {type: "api.memos.dev/WorkspaceSetting"}
];
}
```
I would expect a path to be generated like this:
```yaml
paths:
/api/v1/{name}:
get:
tags:
- WorkspaceService
description: Gets a workspace setting.
operationId: WorkspaceService_GetWorkspaceSetting
parameters:
- name: name
in: path
description: The setting id.
required: true
schema:
type: string
```
This is the offending code:
https://github.com/google/gnostic/blob/e0e09f70628157dc0db87ed60a109465ae62723b/cmd/protoc-gen-openapi/generator/generator.go#L508-L516
Here is the description of the feature from the Transcoding proto:
https://github.com/googleapis/googleapis/blob/f8776fec04e336527ba7279d960105533a1c4e21/google/api/http.proto#L68
Contributor guide
Assessment
This issue has not been assessed yet.