Method Standards.JSON.Validator()->validate_integer()


Method validate_integer

private string|zero validate_integer(string key, mixed value, mapping(string:mixed) schema)

Description

Verify that the specified value is an integer according to the specified schema. This is the similar to validate_number(), but the value must be an int and not a float. The following properties of schema are verified:

minimum

If the schema has the property "minimum", then the value must be greater than or equal to the specified minimum.

exclusiveMinimum

If the schema has the properties "minimum" and "exclusiveMinimum" is Standards.JSON.true, then the value must be greater than the specified minimum.

maximum

If the schema has the property "maximum", then the value must be lower than or equal to the specified maximum.

exclusiveMaximum

If the schema has the properties "maximum" and "exclusiveMaximum" is Standards.JSON.true, then the value must be lower than the specified minimum.

multipleOf

If schema has the property "multipleOf", then the value must be an integer multiple of the specified multpleOf.