Creates an endpoint definition and handler that serves the OpenAPI spec as JSON. Register it with builder.handle(ep, handler).
builder.handle(ep, handler)
The spec is lazily generated on first request and cached.
const { endpoint: openApiEp, handler } = createOpenApiEndpoint({ server, info: { title: 'My API', version: '1.0.0' }});server.handle(openApiEp, handler); Copy
const { endpoint: openApiEp, handler } = createOpenApiEndpoint({ server, info: { title: 'My API', version: '1.0.0' }});server.handle(openApiEp, handler);
Creates an endpoint definition and handler that serves the OpenAPI spec as JSON. Register it with
builder.handle(ep, handler).The spec is lazily generated on first request and cached.