How to break swagger 2.0 JSON file into multiple modules

后端 未结 8 809
半阙折子戏
半阙折子戏 2020-12-04 09:41

I\'m trying to break my API document up into multiple JSON files that can be edited independently. All the examples I\'ve been able to find use the Swagger 1.2 schema which

相关标签:
8条回答
  • 2020-12-04 10:34

    I've written about this in this blog post. You can basically use JSON Refs library to resolve all your little Swagger files into one large one and use it in the tools.

    0 讨论(0)
  • 2020-12-04 10:34

    I wrote a Swagger/OpenAPI preprocessor to ease authoring of specifications.

    https://github.com/dolmen-go/openapi-preprocessor/

    In particular it supports $ref pointing to external files and allows to edit your spec as multiple files, but produce a single file for maximum compatibility with tools that will consume it.

    0 讨论(0)
提交回复
热议问题