4

My API documentation is getting quite large and I was wondering if it was possible to separate the openapi.yml file into separately managed chunks rather than having it all in one and have reDoc (or some other tool) combine it and then generate the HTML site.

Archimedes Trajano
  • 35,625
  • 19
  • 175
  • 265

1 Answers1

1

Redoc has its own tool for that "Redoc CLI" npm @redocly/cli

checkout their tutorial https://github.com/Redocly/openapi-starter

with this tool you can:

  1. split your actual docs with one command (to paths, components, parameters, schema)
redocly split openapi.yaml --outDir openapi
  1. lint them (separated files or final one)
redocly lint openapi/openapi.yaml
  1. preview (with hot reloading on change)
redocly preview-docs openapi/openapi.yaml
  1. and merge them back when production ready
redocly bundle openapi/openapi.yaml -o openapi.yaml

and even more...

Michal Miky Jankovský
  • 3,089
  • 1
  • 35
  • 36