-
-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The spec says that instances are valid if "dividing by this value results in an integer". This allows integers to be invalid for `multipleOf: 0.5` if float division overflows to infinity (a non-integer); alternatively implementations may choose to implement logic which defines all integers as multiples of 0.5. Either way, however, implementations must not raise an error due to the overflow of a legal value against a legal schema.
- Loading branch information
Showing
8 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[ | ||
{ | ||
"description": "integer with multipleOf=0.5 may be valid but never raises error despite naive overflow to infinity", | ||
"schema": {"type": "integer", "multipleOf": 0.5}, | ||
"tests": [ | ||
{ | ||
"description": "The spec allows this to be valid OR invalid depending on your overflow handling.", | ||
"data": 1e308, | ||
"valid": true | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[ | ||
{ | ||
"description": "integer with multipleOf=0.5 may be valid but never raises error despite naive overflow to infinity", | ||
"schema": {"type": "integer", "multipleOf": 0.5}, | ||
"tests": [ | ||
{ | ||
"description": "The spec allows this to be valid OR invalid depending on your overflow handling.", | ||
"data": 1e308, | ||
"valid": true | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[ | ||
{ | ||
"description": "integer with multipleOf=0.5 may be valid but never raises error despite naive overflow to infinity", | ||
"schema": {"type": "integer", "multipleOf": 0.5}, | ||
"tests": [ | ||
{ | ||
"description": "The spec allows this to be valid OR invalid depending on your overflow handling.", | ||
"data": 1e308, | ||
"valid": true | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[ | ||
{ | ||
"description": "integer with multipleOf=0.5 may be valid but never raises error despite naive overflow to infinity", | ||
"schema": {"type": "integer", "multipleOf": 0.5}, | ||
"tests": [ | ||
{ | ||
"description": "The spec allows this to be valid OR invalid depending on your overflow handling.", | ||
"data": 1e308, | ||
"valid": true | ||
} | ||
] | ||
} | ||
] |