orval
orval copied to clipboard
Bugs/typed tuple on zod
Status
DONE
Description
Support for typed tuples as they are produced by pydantic v2.0+
Reproduction for issue https://github.com/orval-labs/orval/issues/1592
- in
generateZodValidationSchemaDefinition
, thearray
switch case has to be altered to adhereprefixItems
constraints. IfprefixItems
exists,- [x] a
tuple
has to be pushed into functions instead of array, - [x] each prefixItem has to be parsed and nested into the tuple
- [x] if items exists, a rest function has to be pushed after the tuple with the schema in items
- [x] a
- in parseZodValidationSchemaDefinition:
- [x] logic to add positional parameters to tuple
- [x] logic for the rest functions has to be added
- somewhere:
- [x] prevent .min().max() on tuple.
- [x] Tests added