UNPKG

@beignet/core

Version:

Core framework primitives for Beignet

34 lines 1.27 kB
/** * OpenAPI generation handler * OpenAPI helpers for the Beignet server runtime. */ import type { HttpContractConfig } from "../contracts/index.js"; import type { AppEnvironment } from "./health.js"; import type { HttpRequestLike, HttpResponseLike } from "./types.js"; /** * OpenAPI route handler configuration. */ export interface OpenAPIConfig { /** Enable OpenAPI endpoint (default: false) */ enabled?: boolean; /** * Suggested path for the OpenAPI endpoint (e.g., "/api/openapi.json"). * NOTE: This field is for documentation/metadata only and does not control routing. * You must manually wire the openapiHandler to your desired route. */ suggestedPath?: string; /** API title */ title?: string; /** API version */ version?: string; /** API description */ description?: string; } /** * Create a framework-neutral OpenAPI JSON handler. * * The OpenAPI document is generated lazily on the first request and then cached * for the lifetime of the handler. */ export declare function createOpenAPIHandler(contracts: readonly HttpContractConfig[], openapiConfig: OpenAPIConfig | undefined, _env: AppEnvironment): (req: HttpRequestLike) => Promise<HttpResponseLike>; //# sourceMappingURL=openapi.d.ts.map