Skip to content

Always supply Zod record key type#66

Open
greenlynx wants to merge 1 commit intosinclairzx81:mainfrom
greenlynx:fix-zod4-records
Open

Always supply Zod record key type#66
greenlynx wants to merge 1 commit intosinclairzx81:mainfrom
greenlynx:fix-zod4-records

Conversation

@greenlynx
Copy link

In Zod v4, the single argument overload of z.record() has been dropped: https://zod.dev/v4/changelog?id=drops-single-argument-usage

This PR supplies z.string() as the key instead of using the single argument overload, which is equivalent, and also compatible with Zod v3.

This provides enough Zod v4 compatibility for us to use typebox-codegen today, before a "proper" Zod v4-compatible version is release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants