With the new --export-types flag, all schema are defined as TS types as well. The schema definition included a type assignment to the generated type. This is useful for schemas that are too large for TS to infer like deeply nested objects.
OpenApi supports minimum, maximum, minLength, minItems, etc. which are transpiled to the zod .min(), .max(), etc. methods on the schema.
These methods are not supported on z.ZodType types which causes a TS error when schemas are a non-object type and have these validation attributes on them.
This PR limits the OpenApi types for which non-circular types will be generated when --export-types is passed to only object types.
Additionally, the boolean lib option in the playground has been broken. This PR properly sets booleans in options when the lib options are saved.
With the new --export-types flag, all schema are defined as TS types as well. The schema definition included a type assignment to the generated type. This is useful for schemas that are too large for TS to infer like deeply nested objects. OpenApi supports
minimum
,maximum
,minLength
,minItems
, etc. which are transpiled to the zod.min()
,.max()
, etc. methods on the schema. These methods are not supported onz.ZodType
types which causes a TS error when schemas are a non-object type and have these validation attributes on them. This PR limits the OpenApi types for which non-circular types will be generated when--export-types
is passed to onlyobject
types.Additionally, the boolean lib option in the playground has been broken. This PR properly sets booleans in options when the lib options are saved.