grpc-ecosystem/grpc-gateway

Please add option to use FQN as swagger name

开放

#471 创建于 2017年10月7日

 (1 条评论) (0 个反应) (0 位负责人)Go (2,250 个派生)batch import
enhancementhelp wantedopenapi

仓库指标

星标
 (16,971 个星标)
PR 合并指标
 (平均合并 8天 23小时) (30 天内合并 147 个 PR)

描述

The default logic to map FQN to swagger name is good(https://github.com/grpc-ecosystem/grpc-gateway/blob/master/protoc-gen-swagger/genswagger/template.go#L332).

We have many proto files. and they have some import with each other. Use the logic to shortten FQN is not so good in some case.

e.g.

retail.proto has message CreateOrderRequest {} warehouse.proto also has message CreateOrderRequest {}

If warehouse.proto was imported by retail, warehouse.CreateOrderRequest will use warehouseCreateOrderRequest as swagger name in retail.swagger.json. But the swagger file generated by warehouse.proto was CreateOrderRequest. It's hard for us to merge the two swagger file into one.

I prefer keep the FQN as swagger name, any ideas ?

贡献者指南