Table of Contents
Validating json data could be a real pain without the right tools. With this validator you can check whether a json is compliant with your schema and save yourself lots of if statements and useless code.
The main class is JSONSchemaValidator.cfc, inside the core folder.
The followings are the public methods you can use:
-
validate return an array of structures containing infos, messages, types and details of the errors.
validate(required String json, required String schemaPath)
-
getAllErrors will return errors as a flat array
getAllErrors(required String json, required String schemaPath)
-
addError lets you add custom errors
addError(required String type, required String message, String pointer, Struct details)
Alessio De Padova [email protected] for CF dev, Java dev and tests.
Chris Mair [email protected] for Java dev.
Roberto Marzialetti [email protected].
Everit Kft for JSON Schema Validator on which this wrapper is based.