marsofsnow

Results 3 issues of marsofsnow

我在api里定义了这样一个请求,其中Auth是来自header InstallRequest { Auth string `header:"auth,optional"` //报文头 FileName string `form:"fileName"` //安装的文件名 } 最后生成swagger后, ![27e5097e1a833aa20c5480d0b504e25](https://user-images.githubusercontent.com/18628671/198943706-d2ef55de-5f91-4a9f-bd25-c7f5a54680fa.png) swagger文档显示这个字段是query.这样会给人误解,以为这个是个查询参数.前端什么的是把这个作为form参数提交.其实他是header的值

我在A.api定义 type ( Item { Id string `json:"id"` } ) Bug场景: 然后我在B.api使用A中的Item 最后,我在main.api中导入A.api,B.api; main.api作为总的api管理A.api和B.api 这时会报the nested api does not support import 正常的场景: 我在B.api不使用A中的Item 而在main.api中用A中的Item, main.api 导入A.api,B.api. main.api作为总的api管理A.api和B.api 这时能正常生成swagger.json文件

1.通过命令 GOPROXY=https://goproxy.cn/,direct go install github.com/zeromicro/goctl-swagger@latest 安装的goctl-swagger版本是20210116 2.先克隆代码仓库,在go install 安装的版本才是20220621