Open linfanxxxx opened 3 years ago
Version 2.1.0 will include int32, see #22 and #25. Until then you can add:
const MIN_INT32 = -(2 ** 31)
const MAX_INT32 = 2 ** 31 - 1
function validateInt32(value) {
return Number.isInteger(value) && value <= MAX_INT32 && value >= MIN_INT32
}
ajv.addFormat("int32", {type: "number", validate: validateInt32})
I am wondering if it would work with 6.12.6... You can definitely require just the format definition out of it and add manually.
please,i need format: int 32 , bug ajv don't include