-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
int64 validation is incorrect #90
Comments
I'm not familiar with the overflow behavior in JS, but letting it overflow on platforms that don't support long integers and perform the exact comparison on platforms that do would seemingly be better. This is not a proposed fix, just an illustration of the idea:
|
From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#number_type
You could override the format, or create a new format (i.e. int64safe), and set the validation function to use Using Node.js:
|
ajv-formats/src/formats.ts
Line 252 in 4dd6544
The second part of the sentence does not follow from the first. Neither JS nor JSON do not throw on overflows.
Consider this:
The text was updated successfully, but these errors were encountered: