OpenAPI Format Example
Auto-generated API docs from OpenAPI 3.0 specification
This page demonstrates automatic API documentation generation from an OpenAPI 3.0 specification.
The component automatically detects the format and parses it into our documentation system.
Auto-Detection
The `ApiReference` component automatically detects OpenAPI format when you use `parser="auto"` (the default).
Loading API specification...
About This Example
This example shows how the parser handles:
- โ OpenAPI 3.0 format detection
- โ
Schema references (
$ref) resolution - โ
Path parameters (
{id}converted to:id) - โ Request/Response schemas with examples
- โ Security schemes (Bearer tokens, API keys)
- โ Multiple response codes (success and errors)
Using Your Own OpenAPI Spec
To use your own OpenAPI specification:
- Place your spec file in the
/public/api-specs/directory - Reference it in your MDX file:
mdx
1<ApiReference spec="/api-specs/your-api.json" parser="openapi" />Or let it auto-detect:
mdx
1<ApiReference spec="/api-specs/your-api.json" />The parser supports both OpenAPI 3.x and Swagger 2.0 formats.