Pike v8.0 release 1738

Method Standards.JSON.Validator()->validate()


Method validate

string validate(mixed json)

Description

This function validates a JSON object against the JSON schema that was specified in the Validator's constructor. If the JSON object is not valid, a string with an error-message is returned. If the JSON object is valid, 0 is returned.

Parameter json

The JSON object to validate.

Returns

0, if the json object is valid, and an error-message if it is not valid.