Skip to content
PHP JavaScript
Latest commit f972c61 Jan 24, 2012 Jess Telford Fixes #1 - minor typo left-over from JS version


JSON Schema PHP Validator

JSON Schema

JSON Schema is a specification for a JSON-based format for defining the structure of JSON data. JSON Schema provides a contract for what JSON data is required for a given application and how it can be modified, much like what XML Schema provides for XML. JSON Schema is intended to provide validation, documentation, and interaction control of JSON data. -

JSON Schema Validator for PHP

Json schema validator in php. It is a PHP class that validates a json data structure against a schema definition. It is a simple class that returns an object containing the result and errors that happened. -

Usage Example

$schema = json_decode('{ type : "object", properties : { a : { type : "string" }} }');
$json = json_decode('{ a : 1 }');

$result = JsonSchema::validate(

if (!$result->valid) {
    echo "Errors: \n";
Something went wrong with that request. Please try again.