Skip to content
PHP JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
seleniumTests adding the php type cast mode, where string data that represents a va…
JsonSchema.php Fixes #1 - minor typo left-over from JS version
JsonSchemaUndefined.php little refactoring to work easier on other servers
README.markdown Fix tab/space formatting issue
functions.js
interface.css beta 2 version with complete functionalities and selenium test suite
interface.js adding the php type cast mode, where string data that represents a va…
jquery.js
jsonschema.js beta 2 version with complete functionalities and selenium test suite
validate.php adding the php type cast mode, where string data that represents a va…
validator.html adding the php type cast mode, where string data that represents a va…

README.markdown

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. - http://code.google.com/p/jsonschema/

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. - http://sourceforge.net/projects/jsonschemaphpv/

Usage Example

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

$result = JsonSchema::validate(
    $json,
    $schema
);

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