(annotations?: Annotations.Filter): SchemaAST.FilterGroup<number>Validates that a number is a 32-bit signed integer (range: -2,147,483,648 to 2,147,483,647).
Details
JSON Schema:
This check corresponds to the format: "int32" constraint in OpenAPI 3.1,
or minimum/maximum constraints in other JSON Schema targets.
Arbitrary:
When generating test data with fast-check, this applies integer and range constraints to ensure generated numbers are 32-bit signed integers.
export function function isInt32(
annotations?: Annotations.Filter
): SchemaAST.FilterGroup<number>
Validates that a number is a 32-bit signed integer (range: -2,147,483,648 to
2,147,483,647).
Details
JSON Schema:
This check corresponds to the format: "int32" constraint in OpenAPI 3.1,
or minimum/maximum constraints in other JSON Schema targets.
Arbitrary:
When generating test data with fast-check, this applies integer and range
constraints to ensure generated numbers are 32-bit signed integers.
isInt32(annotations: Annotations.Filter | undefinedannotations?: Annotations.interface Annotations.FilterAnnotations for filter schema nodes (created via Schema.filter). Extends
Augment
with an optional error message, identifier, and metadata.
Filters are intentionally non-parametric to keep them covariant.
Filter) {
return new import SchemaASTSchemaAST.constructor FilterGroup<number>(checks: readonly [SchemaAST.Check<number>, ...SchemaAST.Check<number>[]], annotations?: Annotations.Filter | undefined): SchemaAST.FilterGroup<number>FilterGroup(
[
function isInt(
annotations?: Annotations.Filter
): SchemaAST.Filter<number>
Validates that a number is a safe integer (within the safe integer range
that can be exactly represented in JavaScript).
Details
JSON Schema:
This check corresponds to the type: "integer" constraint in JSON Schema.
Arbitrary:
When generating test data with fast-check, this applies an integer: true
constraint to ensure generated numbers are integers.
isInt(annotations: Annotations.Filter | undefinedannotations),
const isBetween: (
options: {
readonly minimum: unknown
readonly maximum: unknown
readonly exclusiveMinimum?:
| boolean
| undefined
readonly exclusiveMaximum?:
| boolean
| undefined
},
annotations?: Annotations.Filter
) => SchemaAST.Filter<unknown>
Validates that a number is within a specified range. The range boundaries can
be inclusive or exclusive based on the provided options.
Details
JSON Schema:
This check corresponds to minimum/maximum or exclusiveMinimum/exclusiveMaximum
constraints in JSON Schema, depending on the options provided.
Arbitrary:
When generating test data with fast-check, this applies minimum and
maximum constraints with optional exclusiveMinimum and
exclusiveMaximum flags to ensure generated numbers fall within the
specified range.
isBetween({ minimum: unknownminimum: -2147483648, maximum: unknownmaximum: 2147483647 })
],
{
Annotations.Augment.expected?: string | undefinedHuman-readable description of what a value is expected to satisfy.
Details
For filter and refinement failures, the default formatter uses
message first, then expected, and finally falls back to <filter>.
Use this to name a failed filter in the default message:
Expected <expected>, got <actual>.
expected: "a 32-bit integer",
...annotations: Annotations.Filter | undefinedannotations
}
)
}