Divisibleby - sgpinkus/json-schema GitHub Wiki

THIS WIKI IS OBSOLETE. PLEASE SEE THE NEW JSON-SCHEMA-ORG/JSON-SCHEMA-SPEC REPOSITORY.



Description

A numeric instance is valid against divisibleBy if and only if the remainder of the division of the instance by this keyword's value is 0.

Allowed values

The value of divisibleBy MUST be a number. What is more, that number MUST be strictly greater than 0.

Example

Against this schema:

{
    "divisibleBy": 5.4
}

the following instances are valid:

  • 0;
  • 10.8;
  • 5.4;
  • -5.4;
  • 108000000000000540.

The following instances are invalid:

  • 10.80000000000000000000000000000000000000001;
  • 5.5.
⚠️ **GitHub.com Fallback** ⚠️