@nahkies/typescript-fetch-runtime
Version:
Runtime package for code generated by @nahkies/openapi-code-generator using the typescript-fetch template
16 lines (14 loc) • 372 B
text/typescript
import type {z} from "zod"
import {responseValidationFactoryFactory} from "./common"
export function responseValidationFactory(
possibleResponses: [string, z.ZodTypeAny][],
defaultResponse?: z.ZodTypeAny,
) {
return responseValidationFactoryFactory(
(schema, value) => {
return schema.parse(value)
},
possibleResponses,
defaultResponse,
)
}