Tools, FAQ, Tutorials:
JSON Schema Validation for JSON Number Values
What validation keywords I can use in JSON Schema to specifically validate JSON Number values?
✍: FYIcenter.com
The current JSON Schema specification supports the following validation keywords
to specifically validate JSON Number values.
They are not applied if the JSON instance is not a JSON Number.
"multipleOf" - If the JSON instance is a number, it must be a multiple of the given value. For example:
JSON Schema:
{"multipleOf": 3}
Valid JSON instance:
-9
Valid JSON instance:
"-8"
Invalid JSON instance:
-8
"maximum" - If the JSON instance is a number, it must be less than or equal to the given value. For example:
JSON Schema:
{"maximum": 99}
Valid JSON instance:
99
Valid JSON instance:
"100"
Invalid JSON instance:
100
"exclusiveMaximum" - If the JSON instance is a number, it must be less than the given value. For example:
JSON Schema:
{"exclusiveMaximum": 99}
Valid JSON instance:
98
Valid JSON instance:
"100"
Invalid JSON instance:
99
"minimum" - If the JSON instance is a number, it must be greater than or equal to the given value. For example:
JSON Schema:
{"minimum": 10}
Valid JSON instance:
10
Valid JSON instance:
"9"
Invalid JSON instance:
9
"exclusiveMinimum" - If the JSON instance is a number, it must be greater than the given value. For example:
JSON Schema:
{"exclusiveMinimum": 10}
Valid JSON instance:
11
Valid JSON instance:
"10"
Invalid JSON instance:
10
⇒ JSON Schema Validation for JSON String Values
2017-09-01, ∼2015🔥, 0💬
Popular Posts:
How to use "{{...}}" Liquid Codes in "set-body" Policy Statement? The "{{...}}" Liquid Codes in "set...
How to validate the id_token signature received from Azure AD v2.0 authentication response? You can ...
What is EPUB 2.0 Metadata "dc:creator" and "dc:contributor" elements? EPUB 2.0 Metadata "dc:creator"...
How to add request query string Parameters to my Azure API operation to make it more user friendly? ...
How to read RSS validation errors at w3.org? If your RSS feed has errors, the RSS validator at w3.or...