Tools, FAQ, Tutorials:
Generic JSON Schema Validation Keywords
What are other generic JSON Schema validation keywords?
✍: FYIcenter.com
Several other generic JSON Schema validation keywords are listed below.
They are always applied to the JSON instance.
"enum" - The JSON instance must match one of the elements in the given array. For example,
JSON Schema: {"enum": ["YES", "NO"]} Valid JSON instance: "YES" Invalid JSON instance: "Yes" Invalid JSON instance: 3.14
"const" - The JSON instance must match the given value. For example,
JSON Schema: {"const": 3.14} Valid JSON instance: 3.14 Invalid JSON instance: 3.14159 Invalid JSON instance: "PI"
"allOf" - The JSON instance must be valid against all schemas in the given array. For example,
JSON Schema: {"allOf": [ {"type": "number"}, {"const": 3.14} ]} Valid JSON instance: 3.14 Invalid JSON instance: 3.14159 Invalid JSON instance: "PI"
"anyOf" - The JSON instance must be valid against at least one schema in the given array. For example,
JSON Schema: {"anyOf": [ {"const": "YES"}, {"const": "NO"} ]} Valid JSON instance: "YES" Invalid JSON instance: "Yes" Invalid JSON instance: 3.14
"oneOf" - The JSON instance must be valid against at exactly one schema in the given array. For example,
JSON Schema: {"oneOf": [ {"type": "integer"}, {"type": "number"} ]} Valid JSON instance: 1.00 Invalid JSON instance: 1 Invalid JSON instance: "One"
"not" - The JSON instance must be invalid against the given schema. For example,
JSON Schema: {"not": {"type": "integer"}, } Valid JSON instance: 1.00 Valid JSON instance: "One" Invalid JSON instance: 1
Â
⇒Introduction of JSON Schema
⇒⇒JSON Tutorials
2017-08-25, 1146👍, 0💬
Popular Posts:
How to add request query string Parameters to my Azure API operation 2017 version to make it more us...
What is test testing area for? The testing area is provided to allow visitors to post testing commen...
How To Pad an Array with the Same Value Multiple Times in PHP? If you want to add the same value mul...
Where to find tutorials on how to Read and Write Files in PHP? A collection of tutorials to answer m...
How to use "json-to-xml" Azure API Policy Statement? The "json-to-xml" Policy Statement allows you t...