Tools, FAQ, Tutorials:
JSON Schema Validation for JSON String Values
What validation keywords I can use in JSON Schema to specifically validate JSON String values?
✍: FYIcenter.com
The current JSON Schema specification supports the following validation keywords to specifically validate JSON Strings values. They are not applied if the JSON instance is not a JSON String.
"maxLength" - If the JSON instance is a string, its length must be less than or equal to the given value. For example:
JSON Schema: {"maxLength": "5"} Valid JSON instance: "Hello!" Valid JSON instance: 3.14159 Invalid JSON instance: "Hello world!"
"minLength" - If the JSON instance is a string, its length must be greater than or equal to the given value. For example:
JSON Schema: {"minLength": "5"} Valid JSON instance: "Hello!" Valid JSON instance: 3.14159 Invalid JSON instance: "Hi!"
"pattern" - If the JSON instance is a string, it must result a match for the given regular expression. For example:
JSON Schema: {"pattern": ".*@.*"} Valid JSON instance: "help@fyicenter.com" Valid JSON instance: 3.14159 Invalid JSON instance: "Hello world!"
⇒ JSON Schema Validation for JSON Array Values
2017-09-01, 1683🔥, 0💬
Popular Posts:
How to read RSS validation errors at w3.org? If your RSS feed has errors, the RSS validator at w3.or...
How To Remove Slashes on Submitted Input Values in PHP? By default, when input values are submitted ...
How to extend json.JSONEncoder class? I want to encode other Python data types to JSON. If you encod...
Where to get the detailed description of the JSON.stringify() Function in JavaScript? Here is the de...
How to add request query string Parameters to my Azure API operation to make it more user friendly? ...