gnostic icon indicating copy to clipboard operation
gnostic copied to clipboard

openapiv3 tags

Open 1226151667 opened this issue 3 years ago • 7 comments

After setting the tag, why not overwrite the original default but recreate the tag, proto file:

service Test {
	rpc CreateTest (CreateTestRequest) returns (CreateTestReply) {
		option (google.api.http) = {
			post: "/api/test",
			body: "*"
		};
		option (openapi.v3.operation) = {
			tags: ["TS1"],
		};
	}
}

yaml file:

paths:
    /api/test:
        post:
            tags:
                - Test
                - TS1
         ..................

How do I do it, please, Thanks!

1226151667 avatar Aug 10 '22 08:08 1226151667

I have the same problem as you

an15221315127 avatar Oct 17 '22 02:10 an15221315127

I have the same problem as you

shuqingzai avatar Jan 20 '23 03:01 shuqingzai

I am experiencing similar behavior. Is there a way to suppress the "default" tag of the service and just use the specified tags?

alex-sberna avatar Apr 07 '23 17:04 alex-sberna

I had the same problem, checked the source code and found that this is hardcoded and currently impossible to change

It uses GoName as the default tag and adds it to document

https://github.com/google/gnostic/blob/ade94e0d08cb9c60272a311608cd5dabd30d1813/cmd/protoc-gen-openapi/generator/generator.go#L587

https://github.com/google/gnostic/blob/ade94e0d08cb9c60272a311608cd5dabd30d1813/cmd/protoc-gen-openapi/generator/generator.go#L739

https://github.com/google/gnostic/blob/ade94e0d08cb9c60272a311608cd5dabd30d1813/cmd/protoc-gen-openapi/generator/generator.go#L754

shuqingzai avatar Apr 15 '23 17:04 shuqingzai