diff --git a/_examples/openapi.gen.yaml b/_examples/openapi.gen.yaml index 430ae6d..7709156 100644 --- a/_examples/openapi.gen.yaml +++ b/_examples/openapi.gen.yaml @@ -501,6 +501,7 @@ components: paths: /rpc/ExampleService/Ping: post: + operationId: ExampleService-Ping tags: ["ExampleService"] summary: "Deprecated." deprecated: true @@ -542,6 +543,7 @@ paths: - $ref: '#/components/schemas/ErrorDatabaseDown' /rpc/ExampleService/GetUser: post: + operationId: ExampleService-GetUser tags: ["ExampleService"] summary: "Deprecated: Use GetUserV2 instead." deprecated: true @@ -585,6 +587,7 @@ paths: - $ref: '#/components/schemas/ErrorDatabaseDown' /rpc/ExampleService/GetUserV2: post: + operationId: ExampleService-GetUserV2 tags: ["ExampleService"] summary: "GetUserV2 returns user based on given userID." security: @@ -629,6 +632,7 @@ paths: - $ref: '#/components/schemas/ErrorDatabaseDown' /rpc/ExampleService/FindUser: post: + operationId: ExampleService-FindUser tags: ["ExampleService"] summary: "FindUser searches for a user using the given search filter." security: @@ -676,6 +680,7 @@ paths: - $ref: '#/components/schemas/ErrorDatabaseDown' /rpc/ExampleService/ListUsers: post: + operationId: ExampleService-ListUsers tags: ["ExampleService"] summary: "ListUsers returns all users." security: @@ -718,6 +723,7 @@ paths: - $ref: '#/components/schemas/ErrorDatabaseDown' /rpc/ExampleService/GetComplex: post: + operationId: ExampleService-GetComplex tags: ["ExampleService"] summary: "" requestBody: @@ -758,6 +764,7 @@ paths: - $ref: '#/components/schemas/ErrorDatabaseDown' /rpc/ExampleService/GetAllOptional: post: + operationId: ExampleService-GetAllOptional tags: ["ExampleService"] summary: "" requestBody: @@ -798,6 +805,7 @@ paths: - $ref: '#/components/schemas/ErrorDatabaseDown' /rpc/AdminService/ListUsers: post: + operationId: AdminService-ListUsers tags: ["AdminService"] summary: "" security: diff --git a/main.go.tmpl b/main.go.tmpl index 7aa1939..627199d 100644 --- a/main.go.tmpl +++ b/main.go.tmpl @@ -134,6 +134,7 @@ paths: {{- $deprecated := index $method.Annotations "deprecated" }} /rpc/{{$service.Name}}/{{$method.Name}}: post: + operationId: {{$service.Name}}-{{$method.Name}} tags: ["{{$service.Name}}"] summary: {{ if $deprecated }}{{ if $deprecated.Value }}{{printf "%q" (print "Deprecated: " $deprecated.Value)}}{{else}}"Deprecated."{{end}}{{else if gt (len $method.Comments) 0}}{{printf "%q" (index $method.Comments 0)}}{{else}}""{{end}} {{- if $deprecated }}