drz5553 2019-08-22 00:11
浏览 791

合并多个Swagger JSON

I have multiple API's I'm writing in GoLang. Let's say I have one for Books and another for Customers. I have the standard REST endpoints for both and am using go-swagger to generate a swagger.json file. I end up with one json for Books and another for Customers. I'm able to serve these individually but how do I merge the two jsons into one so that I can serve one file and have Swagger documentation for both Books and Customers in one place?

One approach was to convert Books and Customers to exportable libraries and then have another main.go in the root directory that imports and uses those libraries, but I don't really like this hacky way. Is there a way to merge multiple individual swagger jsons?

I tried using the -i flag mentioned here https://goswagger.io/use/spec.html but that didn't work correctly.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥40 复杂的限制性的商函数处理
    • ¥15 程序不包含适用于入口点的静态Main方法
    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码