Libraries
    Preparing search index...
    • 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.

      Parameters

      Returns { endpoint: EndpointBuilder<unknown>; handler: () => OpenApiDocument }

      const { endpoint: openApiEp, handler } = createOpenApiEndpoint({
      server,
      info: { title: 'My API', version: '1.0.0' }
      });
      server.handle(openApiEp, handler);