Class Index | File Index

Classes


Class finesse.utilities.JsonValidator

For JSON validation
Defined in: finesse.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
<static>  
finesse.utilities.JsonValidator.validateJson(jsonData, schema)
Validates JSON data by applying a specific schema
Class Detail
finesse.utilities.JsonValidator()
Method Detail
<static> finesse.utilities.JsonValidator.validateJson(jsonData, schema)
Validates JSON data by applying a specific schema
Parameters:
jsonData
- JSON data
schema
- JSON schema that would validate the parameter jsonData. It needs to follow the JSON schema definition standard
Returns:
- JSON Result that is of the below format
 {
   "valid": [true/false], 
   "error": [tv4 error object if schema is not valid]
 }
The error object will look something like this:
{
   "code": 0,
   "message": "Invalid type: string",
   "dataPath": "/intKey",
   "schemaPath": "/properties/intKey/type"
}

Documentation generated by JsDoc Toolkit 2.3.2 on Thu Jan 02 2020 09:55:47 GMT-0500 (EST)