Skip to content

Release v0.5.1: Fixed z.record() schema display

Choose a tag to compare

@liorcodev liorcodev released this 28 Jan 09:30
· 15 commits to main since this release

[0.5.1] - 2026-01-28

Fixed

  • z.record() schema display - Fixed issue where z.record(z.string(), z.string()) and other
    record schemas were incorrectly displayed as {} in both TypeScript types and JSON examples
    • Now properly generates Record<string, string> TypeScript notation
    • Generates sample JSON examples like { "key": "string" }
    • Supports all record value types (primitives, objects, arrays, etc.)
    • Root cause: Zod's toJSONSchema() converts records using additionalProperties instead of
      properties, which wasn't being handled