How do I combine multiple OpenAPI 3 specification files together?

heitortsergent picture heitortsergent · Feb 8, 2019 · Viewed 11.3k times · Source

I want to combine an API specification written using the OpenAPI 3 spec, that is currently divided into multiple files that reference each other using $ref. How can I do that?

Answer

heitortsergent picture heitortsergent · Feb 8, 2019

One way to do this is to use the open-source project speccy.

Open the terminal and install speccy by running (requires Node.js):

npm install speccy -g

Then run:

speccy resolve path/to/spec.yaml -o spec-output.yaml