Skip to content

fix: Enhance JSDoc numeric format support and validation#357

Open
clicktodev wants to merge 6 commits intofabien0102:mainfrom
clicktodev:support-string-with-jsdoc-number-format
Open

fix: Enhance JSDoc numeric format support and validation#357
clicktodev wants to merge 6 commits intofabien0102:mainfrom
clicktodev:support-string-with-jsdoc-number-format

Conversation

@clicktodev
Copy link

@clicktodev clicktodev commented Nov 25, 2025

Introduce support for additional numeric formats in JSDoc tags and implement custom validation for these formats in the buildZodPrimitiveInternal function.

Tests added.

this fixes the case for int64 and uint64 numbers and also fixes the validation for strings that represent numbers

closes #355

this also covers #356

this fixes Property 'int64' does not exist on type 'ZodString' by adding validation logic for ints.

export const bodySchema = z.object({
    id: z.string().int64(),
});

it can also be fixed by skipping int validation entirely for strings.

i think this behavior should be configurable? validating strings as valid numbers should be optional or not?

@clicktodev clicktodev changed the title Enhance JSDoc numeric format support and validation fix: Enhance JSDoc numeric format support and validation Nov 25, 2025
@clicktodev
Copy link
Author

@fabien0102 would be nice if you merged this!

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.

broken schema when using a string property with @format int64

1 participant