grpc-gateway icon indicating copy to clipboard operation
grpc-gateway copied to clipboard

proto-gen swagger: FQN package name and message name with some delimeter in between them

Open lps0535 opened this issue 6 years ago • 1 comments

Problem: I've a proto file with package name "com.iotc.service.grpc.common" and a message with name PageInfo. When I run protoc-gen-swagger for this proto file and generate swagger doc, My swagger file has following model "commonPageInfo"

Is it possible to generate swagger doc with model name as FQN for package and then message name with "." in between them?

Example: I want this "com.iotc.service.grpc.common.PageInfo" but I'm getting "commonPageInfo".

lps0535 avatar May 17 '18 10:05 lps0535

@lps0535 thanks for the report. This is certainly something we should expose as a param on the generator. Would you be interested in taking a crack at this? The entrypoint is https://github.com/grpc-ecosystem/grpc-gateway/blob/master/protoc-gen-swagger/main.go#L26

tmc avatar Jun 19 '18 05:06 tmc

Is this addressed with openapi_naming_strategy=fqn ?

jgiles avatar Jan 22 '24 18:01 jgiles

It sounds to me like we can close this, thanks Josh :)

johanbrandhorst avatar Jan 24 '24 01:01 johanbrandhorst