Class finesse.utilities.JsonValidator
For JSON validation
Defined in: finesse.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
<static> |
finesse.utilities.JsonValidator.validateJson(jsonData, schema)
Validates JSON data by applying a specific schema
|
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" }