Hyperlinkv0.8.0-beta.28

Schema

Schema.isInt32functioneffect/Schema.ts:7552
(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.

Integer checks
Source effect/Schema.ts:755212 lines
export function isInt32(annotations?: Annotations.Filter) {
  return new SchemaAST.FilterGroup(
    [
      isInt(annotations),
      isBetween({ minimum: -2147483648, maximum: 2147483647 })
    ],
    {
      expected: "a 32-bit integer",
      ...annotations
    }
  )
}