github.com/kaptinlin/jsonschema@v0.4.6/testdata/JSON-Schema-Test-Suite/tests/draft-next/multipleOf.json (about)

     1  [
     2      {
     3          "description": "by int",
     4          "schema": {
     5              "$schema": "https://json-schema.org/draft/next/schema",
     6              "multipleOf": 2
     7          },
     8          "tests": [
     9              {
    10                  "description": "int by int",
    11                  "data": 10,
    12                  "valid": true
    13              },
    14              {
    15                  "description": "int by int fail",
    16                  "data": 7,
    17                  "valid": false
    18              },
    19              {
    20                  "description": "ignores non-numbers",
    21                  "data": "foo",
    22                  "valid": true
    23              }
    24          ]
    25      },
    26      {
    27          "description": "by number",
    28          "schema": {
    29              "$schema": "https://json-schema.org/draft/next/schema",
    30              "multipleOf": 1.5
    31          },
    32          "tests": [
    33              {
    34                  "description": "zero is multiple of anything",
    35                  "data": 0,
    36                  "valid": true
    37              },
    38              {
    39                  "description": "4.5 is multiple of 1.5",
    40                  "data": 4.5,
    41                  "valid": true
    42              },
    43              {
    44                  "description": "35 is not multiple of 1.5",
    45                  "data": 35,
    46                  "valid": false
    47              }
    48          ]
    49      },
    50      {
    51          "description": "by small number",
    52          "schema": {
    53              "$schema": "https://json-schema.org/draft/next/schema",
    54              "multipleOf": 0.0001
    55          },
    56          "tests": [
    57              {
    58                  "description": "0.0075 is multiple of 0.0001",
    59                  "data": 0.0075,
    60                  "valid": true
    61              },
    62              {
    63                  "description": "0.00751 is not multiple of 0.0001",
    64                  "data": 0.00751,
    65                  "valid": false
    66              }
    67          ]
    68      },
    69      {
    70          "description": "float division = inf",
    71          "schema": {
    72              "$schema": "https://json-schema.org/draft/next/schema",
    73              "type": "integer",
    74              "multipleOf": 0.123456789
    75          },
    76          "tests": [
    77              {
    78                  "description": "always invalid, but naive implementations may raise an overflow error",
    79                  "data": 1e308,
    80                  "valid": false
    81              }
    82          ]
    83      },
    84      {
    85          "description": "small multiple of large integer",
    86          "schema": {
    87              "$schema": "https://json-schema.org/draft/next/schema",
    88              "type": "integer", "multipleOf": 1e-8
    89          },
    90          "tests": [
    91              {
    92                  "description": "any integer is a multiple of 1e-8",
    93                  "data": 12391239123,
    94                  "valid": true
    95              }
    96          ]
    97      }
    98  ]