@kubb/plugin-zod
Version:
Zod schema generator plugin for Kubb, creating type-safe validation schemas from OpenAPI specifications for runtime data validation.
37 lines (35 loc) • 648 B
text/typescript
/**
* Generated by Kubb (https://kubb.dev/).
* Do not edit manually.
*/
import { z } from 'zod'
export const advanced = z.union([
z
.lazy(() => enumerationValueSpecificationDto)
.and(
z.object({
type: z.literal('enum'),
}),
),
z
.lazy(() => rangeValueSpecificationDto)
.and(
z.object({
type: z.literal('range'),
}),
),
z
.lazy(() => regexValueSpecificationDto)
.and(
z.object({
type: z.literal('regex'),
}),
),
z
.lazy(() => sliderValueSpecificationDto)
.and(
z.object({
type: z.literal('slider'),
}),
),
])