Skip to content

Commit 62f0b3d

Browse files
committed
fix: add z.record() schema support and bump to v0.5.1
1 parent 8e63e32 commit 62f0b3d

10 files changed

Lines changed: 297 additions & 289 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ dist/
44
.DS_Store
55
.idea
66
src/assets-inline.ts
7+
/.prettierrc

CHANGELOG.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,20 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project
6+
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.5.1] - 2026-01-28
9+
10+
### Fixed
11+
12+
- **z.record() schema display** - Fixed issue where `z.record(z.string(), z.string())` and other
13+
record schemas were incorrectly displayed as `{}` in both TypeScript types and JSON examples
14+
- Now properly generates `Record<string, string>` TypeScript notation
15+
- Generates sample JSON examples like `{ "key": "string" }`
16+
- Supports all record value types (primitives, objects, arrays, etc.)
17+
- Root cause: Zod's `toJSONSchema()` converts records using `additionalProperties` instead of
18+
`properties`, which wasn't being handled
819

920
## [0.5.0] - 2026-01-22
1021

@@ -107,6 +118,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
107118
- `Fixed` - Bug fixes
108119
- `Security` - Vulnerability fixes
109120

110-
[Unreleased]: https://github.com/liorcohen/trpc-docs-generator/compare/v0.5.0...HEAD
121+
[Unreleased]: https://github.com/liorcohen/trpc-docs-generator/compare/v0.5.1...HEAD
122+
[0.5.1]: https://github.com/liorcohen/trpc-docs-generator/compare/v0.5.0...v0.5.1
111123
[0.5.0]: https://github.com/liorcohen/trpc-docs-generator/releases/tag/v0.5.0
112124
[0.1.0]: https://github.com/liorcohen/trpc-docs-generator/releases/tag/v0.1.0

0 commit comments

Comments
 (0)