@asteasolutions/zod-to-openapi
Version:
Builds OpenAPI schemas from Zod schemas
15 lines (14 loc) • 572 B
TypeScript
import { ZodUnion } from 'zod';
import { MapNullableOfArray, MapSubSchema } from '../types';
import { UnionPreferredType } from '../zod-extensions';
export declare class UnionTransformer {
private options?;
constructor(options?: {
unionPreferredType?: UnionPreferredType;
} | undefined);
transform(zodSchema: ZodUnion, mapNullableOfArray: MapNullableOfArray, mapItem: MapSubSchema): {
[x: string]: (import("../types").SchemaObject | import("../types").ReferenceObject)[];
};
private flattenUnionTypes;
private unwrapNullable;
}