Add validation for keywords related to numbers and strings. It may be surprising that keywords like "minimum" or "minLength" don't imply that the instance is a number or string. But that is how JSON Schema is designed. Change-Id: I8805a5fe91ee345931e1c989f174ea2d0be6665a Reviewed-on: https://go-review.googlesource.com/c/tools/+/667975 Reviewed-by: Robert Findley <rfindley@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Jonathan Amsterdam <jba@google.com>
31 lines
846 B
JSON
31 lines
846 B
JSON
[
|
|
{
|
|
"description": "exclusiveMinimum validation",
|
|
"schema": {
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"exclusiveMinimum": 1.1
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "above the exclusiveMinimum is valid",
|
|
"data": 1.2,
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "boundary point is invalid",
|
|
"data": 1.1,
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "below the exclusiveMinimum is invalid",
|
|
"data": 0.6,
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "ignores non-numbers",
|
|
"data": "x",
|
|
"valid": true
|
|
}
|
|
]
|
|
}
|
|
]
|