And why shouldn't it be? JSON is easy to understand visually, easy to parse on both the client and server sides, and is supported in just about every language except aborigine.
Most developers assume the JSON provide is not only error-free also in the proper format. Properties within the schema are defined and with another object containing their expected type.
Numerous other properties are available, all of which may be found at: The validate method accepts two arguments: Let's load the schema we created above, along with the sample JSON we created, and validate it:.
A true valid property signals that the JSON is valid. If the result fails validation, valid will be false and the Validating json request string property will contain an array of error messages detailing why the given property did not pass validation.