Skip to content

RapiDoc renders specs with over a thousand operations, but large specs need the right settings. In order of impact:

read mode renders every operation at once. On an 8 MB spec with 1,128 operations it takes about 6 seconds, against about 1 second in view or focused mode (see Render Modes).

<rapi-doc spec-url="/openapi.json" render-style="focused"></rapi-doc>

A Swagger 2.0 spec is upgraded to OpenAPI 3.x in the reader’s browser on every page load. For a large spec, convert it once in your build instead:

  1. Convert the spec:

    npx swagger2openapi swagger.json --outfile openapi.json
  2. Point RapiDoc at the converted file:

    <rapi-doc spec-url="/openapi.json"></rapi-doc>

By default, schemas start fully expanded. Large, deeply nested schemas render faster when they start collapsed:

<rapi-doc
spec-url="/openapi.json"
render-style="focused"
schema-expand-level="1"
default-schema-tab="schema"
></rapi-doc>
  • schema-expand-level="1": only the first level of each schema is open; readers expand the rest.
  • default-schema-tab="schema": request and response bodies open on the schema tab instead of the example tab, so example blocks aren’t drawn until a reader opens them.

File size matters less than structure. Long Markdown descriptions cost little; what slows rendering is the number of operations and how large and deeply nested their schemas are once $refs are resolved. A schema referenced by hundreds of operations is rendered once for each of them.