Download the PHP package cmpayments/schemavalidator without Composer
On this page you can find all versions of the php package cmpayments/schemavalidator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cmpayments/schemavalidator
More information about cmpayments/schemavalidator
Files in cmpayments/schemavalidator
Package schemavalidator
Short Description SchemaValidator is a PHP implementation for validating JSON against a Schema (also a string), the JSON and Schema are both linted with https://github.com/cmpayments/jsonlint. This library is optimized for speed and performance.
License MIT
Homepage https://github.com/cmpayments/schemavalidator
Informations about the package schemavalidator
Schema Validator for PHP
SchemaValidator is a PHP implementation for validating JSON against a Schema (also a string), the JSON and Schema are both linted with https://github.com/cmpayments/jsonlint. This library is optimized for speed and performance.
Installation
For a quick install with Composer use:
$ composer require cmpayments/schemavalidator
Schema Validator for PHP can easily be used within another app if you have a PSR-4 autoloader, or it can be installed through Composer.
Usage
Example #1 - simple; validate JSON input for syntax errors
Example #2 - advanced; validate JSON input for syntax errors and validate the JSON against a schema
Example #3 - Simple SchemaValidator example; if you are not interested if the JSON (string) is valid or not (since the input is an object)
Example #4 - Advanced SchemaValidator example; if you are not interested if the JSON (string) is valid or not (since the input is an object) but you want to specify some caching options
Other examples
Example; test input when input is an array
Example; test input when input is a boolean
Example; test input when input is a number (float)
Example; test input when input is a number (integer)
Example; test input when input is a string
Requirements
- PHP 5.4+
- [optional] PHPUnit 3.5+ to execute the test suite (phpunit --version)
Submitting bugs and feature requests
Bugs and feature request are tracked on GitHub
Todo
- [ ] Pattern Validation
- [ ] allOf (Validation keywords for any instance type)
- [ ] anyOf (Validation keywords for any instance type)
- [ ] allOf (Validation keywords for any instance type)
- [ ] not (Validation keywords for any instance type)
- [ ] title & description Metadata
- [ ] hostname (Defined Format Attributes)
- [ ] ipv4 (Defined Format Attributes)
- [ ] ipv6 (Defined Format Attributes)
- [ ] uri (Defined Format Attributes)
Author
Boy Wijnmaalen - https://twitter.com/boywijnmaalen
License
Schema Validator is licensed under the MIT License - see the LICENSE file for details