Skip to content

Conversation

@jeremy-code
Copy link
Contributor

Zod 4 (#4074)

  • Remove z.literal(Symbol("terrific")); from docs in api.mdx

Zod 4 (colinhacks#4074)

- Remove `z.literal(Symbol("terrific"));` from docs in api.mdx
@jeremy-code
Copy link
Contributor Author

I believe this is correct because #4074 is anything to go by, the docs should default to Zod v4 (hence metadata.mdx). Per changelog,

z.literal()
drops symbol support
Symbols aren't considered literal values, nor can they be simply compared with ===. This was an oversight in Zod 3.

@colinhacks
Copy link
Owner

Ah good catch!

@colinhacks colinhacks merged commit fa7bee4 into colinhacks:main Jun 2, 2025
4 checks passed
timorthi pushed a commit to timorthi/zod that referenced this pull request Jun 3, 2025
Zod 4 (colinhacks#4074)

- Remove `z.literal(Symbol("terrific"));` from docs in api.mdx
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