Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jesstelford/jsonschemaphp
JSON Schema PHP Validator
https://github.com/jesstelford/jsonschemaphp
Last synced: 28 days ago
JSON representation
JSON Schema PHP Validator
- Host: GitHub
- URL: https://github.com/jesstelford/jsonschemaphp
- Owner: jesstelford
- Created: 2011-10-07T00:42:12.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2012-01-24T12:52:49.000Z (almost 13 years ago)
- Last Synced: 2024-06-11T17:36:59.356Z (7 months ago)
- Language: PHP
- Homepage: http://sourceforge.net/projects/jsonschemaphpv/
- Size: 131 KB
- Stars: 27
- Watchers: 7
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
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/](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/](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);
}