OpenAPI Integration
Documenting an MCP server instead? See MCP Integration.
Sourcey generates API reference documentation from OpenAPI specs. Every operation, parameter, response, and schema is rendered with auto-generated code samples in up to 10 languages.
Supported formats
| Format | Support |
|---|---|
| OpenAPI 3.1 | Native |
| OpenAPI 3.0 | Native |
| Swagger 2.0 | Auto-converted to OpenAPI 3.x at build time |
| YAML | Yes |
| JSON | Yes |
| URL | Yes (fetched at build time) |
Configuration
Add an openapi tab to your config. The path is relative to sourcey.config.ts.
navigation: {
tabs: [
{
tab: "API Reference",
slug: "api",
openapi: "./openapi.yaml",
},
],
}For a quick build from a standalone spec (no config file needed):
sourcey build ./openapi.yamlWhat gets generated
Each tagged group of operations becomes a section in the sidebar. For every operation, sourcey renders:
- HTTP method and path
- Description and summary
- Parameters (path, query, header, cookie) with types and constraints
- Request body schema with examples
- Response schemas for each status code
- Auto-generated code samples
Code samples
Sourcey auto-generates request examples from your spec in up to 10 languages. The default set is curl, javascript, and python. Configure the full list with codeSamples in your config. See the Code Samples reference for all available languages and options.
codeSamples: ["curl", "javascript", "typescript", "python", "go"],Spec validation
Sourcey validates your spec at build time. Invalid specs fail the build with actionable error messages. You can also validate without building:
sourcey validate ./openapi.yaml Valid: My API v1.0.0
Operations: 24
Schemas: 12Validation parses, dereferences, and normalizes the spec. It catches structural issues, missing references, and invalid schema definitions before they break your documentation. See sourcey validate for full details.
