@furystack/rest
Version:
Generic REST package
24 lines • 1.16 kB
TypeScript
import type { ApiEndpointSchema } from './api-endpoint-schema.js';
import type { OpenApiDocument } from './openapi-document.js';
/**
* Converts an OpenAPI `{param}` path format to FuryStack `:param` format.
*
* @param path - The OpenAPI path (e.g. `/users/{id}`)
* @returns The FuryStack path (e.g. `/users/:id`)
*/
export declare const convertOpenApiPathToFuryStack: (path: string) => string;
/**
* Converts an OpenAPI 3.x document to a FuryStack `ApiEndpointSchema`.
*
* This enables consuming external OpenAPI documents with FuryStack's runtime pipeline.
* Preserves operation-level metadata (tags, deprecated, summary, description) and
* document-level metadata (servers, tags, contact, license, securitySchemes).
*
* **Important:** If the document contains `$ref` pointers, call `resolveOpenApiRefs(doc)`
* first to inline them. This function does not resolve `$ref` on its own.
*
* @param doc - The OpenAPI document to convert
* @returns An ApiEndpointSchema that can be used with FuryStack's API tools
*/
export declare const openApiToSchema: (doc: OpenApiDocument) => ApiEndpointSchema;
//# sourceMappingURL=openapi-to-schema.d.ts.map