Skip to content

feat(typescript-zod): validate numeric constraints - #3107

Open
louis-bompart wants to merge 1 commit into
glideapps:masterfrom
coveord:agent/typescript-zod-number-constraints
Open

feat(typescript-zod): validate numeric constraints#3107
louis-bompart wants to merge 1 commit into
glideapps:masterfrom
coveord:agent/typescript-zod-number-constraints

Conversation

@louis-bompart

Copy link
Copy Markdown

Description

Generate Zod numeric schemas with JSON Schema minimum and maximum constraints. Enable the corresponding TypeScript Zod schema fixture feature.

Related Issue

N/A

Motivation and Context

TypeScript Zod output previously discarded numeric bounds, allowing values outside a JSON Schema range through generated schemas.

Previous Behaviour / Output

z.number()

New Behaviour / Output

z.number().min(3).max(5)

How Has This Been Tested?

Ran the TypeScript Zod schema fixtures covering required and optional numeric bounds, $ref values, and union/intersection range cases:

QUICKTEST=true FIXTURE=schema-typescript-zod npm run test:fixtures -- \
  test/inputs/schema/minmax.schema \
  test/inputs/schema/schema-constraints.schema \
  test/inputs/schema/optional-constraints.schema \
  test/inputs/schema/optional-const-ref.schema

Screenshots (if appropriate):

N/A

@louis-bompart
louis-bompart marked this pull request as ready for review August 4, 2026 14:01
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.

1 participant