turtle-express
Version:
`turtle-express` is kinda a framework or a library based on `express.js` with an opinionated express router with type safety and schema validation with zod. Also many [more features](https://github.com/mm-ninja-turtles/turtle-express/discussions/7) planni
16 lines • 921 B
TypeScript
import type { ZodType } from 'zod';
import type { OpenAPIV3_1 } from 'openapi-types';
import type { ExtendsZodWithOpenApiReturnType } from './zod-extends-openapi';
import { z } from 'zod';
/**
* Function to convert each ZodType schema to OpenAPI Request, Parameter, Response schemas.
*/
export declare function zodToOpenApiJson<Schema extends ExtendsZodWithOpenApiReturnType<ZodType>>(schema: Schema): OpenAPIV3_1.ResponseObject | OpenAPIV3_1.ParameterObject[] | OpenAPIV3_1.RequestBodyObject;
/**
* @Credit https://github.com/kbkk/abitia/blob/master/packages/zod-dto/src/OpenApi/zodTypeToOpenApi.ts
* The following function code is inspired and reused some from the above package.
*
* Return the OpenAPI schema for a Zod type.
*/
export declare function createOpenApiJsonElement<Schema extends ExtendsZodWithOpenApiReturnType<z.ZodTypeAny>>(schema: Schema): any;
//# sourceMappingURL=zod-to-open-api-json.d.ts.map