7

I was provided Swagger 2.0 json files for a RESTful API my project is using. The provider does not have SDK, so I'm using the Swagger files to generate a starting point to use for integrating with the service. It's split into 50+ files, grouped by collections of endpoints. How would I combine these into a single JSON or YAML file that conforms to the spec so I can generate SDK for all endpoints at once?

tim
  • 879
  • 1
  • 8
  • 26
  • 1
    Does this answer your question - [How do I combine multiple OpenAPI 3 specification files together?](https://stackoverflow.com/q/54586137/113116) That question is about OAS3 but the answers apply to OAS2 too. – Helen Mar 09 '20 at 20:56
  • 1
    Didn't see that one while searching, but it doesn't look to be quite what I need. I have no `$ref`s to resolve. Would I need to build one file what has `$ref` to pull in everything from each of the individual files? – tim Mar 09 '20 at 21:19

1 Answers1

0

You can use a python script to read the contents of each json file and append them to one single json file. Swagger will read each field and render the ui to display all of the files on a single page.