Skip to content
// EFFECT DAYS 2026

HttpApiSwagger unstable

Swagger documentation UI for declarative HttpApi contracts.

This module mounts a browser-based Swagger UI route on an HttpRouter. The page renders the OpenAPI document derived from the supplied HttpApi, so a running application can expose interactive API documentation without writing a separate OpenAPI file.

1 exports Since v4.0.0 Source

Layers

layer

unstable
Since v4.0.0

Mounts Swagger UI for an HttpApi at the configured path, defaulting to /docs, using the OpenAPI specification generated from the API.

Details

The bundled Swagger UI assets are loaded when the layer is built, not when this module is imported.

Signature

declare function layer<Id extends string, Groups extends Constraint>(api: HttpApi<Id, Groups>, options?: {
readonly path?: `/${string}`;
}): Layer<never, never, HttpRouter>