Skip to content

v0.3.0

Choose a tag to compare

@iamtemi iamtemi released this 30 Nov 14:54
· 17 commits to main since this release

[0.3.0] – 2024-11-30

Added

  • Universal Root Schema Support: Any Zod schema type can now be converted as a root schema
  • Type Alias Generation: Non-object schemas now generate type aliases instead of failing
    • Pydantic: Uses Python 3.12+ type syntax (e.g., type Ipv4 = IPv4Address)
    • TypeScript: Uses export type syntax (e.g., export type Ipv4 = string)
  • Zod v4 Compatibility Improvements:
    • Fixed z.uuid() detection (now correctly generates UUID type in Python)
    • Fixed z.int() detection (now correctly generates int type)
    • Fixed z.iso.date() handling (now generates date in Python, string in TypeScript)
    • Added support for z.ipv4(), z.ipv6(), z.iso.time(), z.iso.duration()
  • Documentation: Added explicit note that only exported schemas are scanned

Fixed

  • Zod v4 String Formats: z.uuid(), z.iso.date(), z.iso.datetime() now correctly detected in Zod v4
  • Zod v4 Number Formats: z.int() now correctly detected in Zod v4
  • Type Generation: Fixed incorrect type generation for ISO date/datetime formats
    • z.iso.date() now correctly maps to Python date (Pydantic parses ISO strings) and TypeScript string
    • z.date() vs z.iso.date() are now properly distinguished

Changed

  • Root Schema Validation: Removed restriction that only objects and enums could be root schemas
  • Error Messages: Improved error handling for non-object schemas (now generates type aliases instead of errors)
  • Documentation: Updated CLI docs with examples of all supported root schema types