Skip to content

feat(typescript-zod): validate string constraints - #3106

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

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

Conversation

@louis-bompart

@louis-bompart louis-bompart commented Aug 4, 2026

Copy link
Copy Markdown

Description

Generate Zod string schemas with JSON Schema minLength, maxLength, and pattern constraints. Enable the corresponding TypeScript Zod fixture features and expand constraint coverage.

Related Issue

N/A

Motivation and Context

TypeScript Zod output previously discarded string length and pattern constraints, allowing invalid input through generated schemas.

Previous Behaviour / Output

z.string()

New Behaviour / Output

z.string().min(3).max(5).regex(new RegExp("^[a-z]+$"))

How Has This Been Tested?

Ran the TypeScript Zod schema fixture suite for string constraints, including valid inputs and feature-specific expected failures for combined constraints, unions/intersections, optional maximum length, escaped patterns, and maxLength: 0:

QUICKTEST=true FIXTURE=schema-typescript-zod npm run test:fixtures -- \
  test/inputs/schema/minmaxlength.schema \
  test/inputs/schema/optional-constraints.schema \
  test/inputs/schema/pattern.schema

Screenshots (if appropriate):

N/A

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