@juspay/neurolink
Version:
Universal AI Development Platform with working MCP integration, multi-provider support, voice (TTS/STT/realtime), and professional CLI. 58+ external MCP servers discoverable, multimodal file processing, RAG pipelines. Build, test, and deploy AI applicatio
35 lines (34 loc) • 1.56 kB
TypeScript
/**
* OpenAPI Routes
* Endpoints for OpenAPI specification and documentation
*/
import type { RouteDefinition, RouteGroup } from "../../types/index.js";
/**
* Create OpenAPI documentation routes
*
* Generates three endpoints for API documentation:
* - GET /api/openapi.json - OpenAPI 3.1 specification in JSON format
* - GET /api/openapi.yaml - OpenAPI 3.1 specification in YAML format
* - GET /api/docs - Interactive Swagger UI documentation
*
* IMPORTANT: The `getRoutes` callback is required to document your custom routes.
* If not provided, the OpenAPI spec will only include default endpoint definitions.
*
* @param basePath - Base path for API routes (default: "/api")
* @param getRoutes - Callback to get registered routes for the OpenAPI spec.
* This callback is invoked at request time, so routes registered
* after creating the OpenAPI route group will be included.
* If not provided, the generator will use default endpoint definitions.
* @returns RouteGroup containing OpenAPI documentation endpoints
*
* @example
* ```typescript
* // RECOMMENDED: Use registerAllRoutes which automatically binds getRoutes
* registerAllRoutes(server, "/api", { enableSwagger: true });
*
* // Or manually provide the routes callback
* const openApiRoutes = createOpenApiRoutes("/api", () => server.listRoutes());
* server.registerRouteGroup(openApiRoutes);
* ```
*/
export declare function createOpenApiRoutes(basePath?: string, getRoutes?: () => RouteDefinition[]): RouteGroup;