OpenAPI
Load an OpenAPI document from a local file, public asset, or URL and generate an API reference.
Add an OpenAPI document to generate an API reference from its operations. The official starters already load the Heyo Docs integration; you only need to add the schema to the documentation configuration.
The interactive Try it panel sends a POST
request to /heyo-docs-internal/openapi-request. It will not work
until the host application provides that endpoint. The generated API reference
remains static and works without it.
Add a schema
Place the schema where its generated endpoint sections should appear in the
sidebar. It accepts JSON or YAML and needs a top-level paths object.
The schema object contains only schema. Heyo Docs replaces it with endpoint
sections grouped by OpenAPI tag. You can place regular MDX pages before or
after it for an overview, authentication, or migration guide.
Choose the source
| Source | Example | Use when |
|---|---|---|
| Local file | "./openapi.json" or "./openapi.yaml" | The schema lives under content/. |
| Public asset | "/openapi.json" | The file is served from the app's public/ directory. |
| URL | "https://api.example.com/openapi.json" | The schema is publicly available during the build. |
Remote schemas are fetched during development and each production build, so use a stable or pinned URL. Private URLs that require credentials are not supported; commit the schema or provide a public build artifact instead.
Add the Try it endpoint
The endpoint forwards only operations and servers declared by the generated OpenAPI model. It is not an open proxy, but it still forwards a reader's bearer token and request values to the declared API server. Protect and monitor the API itself as usual; the proxy is not a substitute for authentication, authorization, rate limiting, or audit logging.
React Router
Add this entry to the existing route array:
Then create app/routes/openapi-request.ts:
Astro
Create src/lib/openapi-request.ts:
Then create src/pages/heyo-docs-internal/openapi-request.ts:
Next.js
Create app/lib/openapi-request.ts:
Then create app/heyo-docs-internal/openapi-request/route.ts:
The Astro route needs a deployment adapter. export const prerender = false
keeps it on demand while the rest of the site stays on output: "static", which
is exactly how the generated template is configured. In a custom DocsApp
shell, point the client at the same route:
What is generated
Each API operation becomes a static reference page. Tags organize the sidebar; the operation method, path, parameters, request body, responses, and local schemas are displayed automatically. A schema change requires a new build and deployment. The browser receives a compact endpoint index while route-specific details are emitted as static assets, so a large schema is not eagerly loaded for every page.
The normal documentation pages remain prerendered whether or not Try it is
enabled. If interactive requests are unnecessary, omit
openApiRequestUrl and the endpoint route without changing the generated API
reference.