TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/elysiajs/documentation/llms.txt
Use this file to discover all available pages before exploring further.
@elysia/openapi plugin automatically generates an OpenAPI specification from your Elysia route definitions and TypeBox schemas. By default it serves an interactive Scalar UI at /openapi and the raw JSON spec at /openapi/json.
Installation
Basic usage
/openapi shows the Scalar UI with generated documentation for every registered endpoint. The raw OpenAPI specification is available at /openapi/json.
Route detail
Each route accepts adetail field that extends the OpenAPI Operation Object. Use it to add descriptions, summaries, tags, and deprecation markers visible in the documentation UI.
Hiding a route
Setdetail.hide to true to exclude a route from the documentation:
Other detail fields
| Field | Description |
|---|---|
summary | Short summary shown in the endpoint list |
description | Verbose explanation of the operation |
deprecated | Mark the operation as deprecated (false by default) |
tags | Group endpoints under named tags |
Configuration
path
Default: '/openapi'
The URL where the documentation UI is served.
provider
Default: 'scalar'
Choose the documentation frontend:
'scalar'— Scalar (default)'swagger-ui'— Swagger UInull— disable the frontend; only the JSON spec endpoint is registered
specPath
Default: '/${path}/json'
The URL where the raw OpenAPI JSON specification is exposed.
documentation
Provide static OpenAPI documentation metadata such as info, servers, and tags. Accepts the full OpenAPI Object.
exclude
Exclude specific paths, methods, or tags from documentation:
scalar
Pass configuration directly to the Scalar UI. Refer to the Scalar configuration docs for all available options.
Self-hosting the Scalar bundle
To serve the Scalar JS bundle from your own server instead of a CDN:swagger
Pass configuration to the Swagger UI frontend. See the Swagger UI configuration docs for details.
mapJsonSchema
Provide a custom function to map a third-party validation schema (such as Valibot) to a standard JSON Schema for the OpenAPI spec:
enabled
Default: true
Set to false to disable the plugin entirely without removing the .use() call, useful for conditional environments.