Download the PHP package aklump/json-schema-validation without Composer
On this page you can find all versions of the php package aklump/json-schema-validation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download aklump/json-schema-validation
More information about aklump/json-schema-validation
Files in aklump/json-schema-validation
Package json-schema-validation
Short Description JSON Schema validation using PHP.
License BSD-3-Clause
Homepage https://github.com/aklump/json-schema-validation
Informations about the package json-schema-validation
JSON Schema Validation
Provides a suite of classes to help with JSON Schema validation.
Validate Data Using JSON Schema
Preparing Data for Validation
In most cases you should prepare data using \AKlump\JsonSchema\JsonDecodeLossless. This has the result of casting to mixed objects and arrays. This is a quirk of using PHP with JSON Schema that doesn't think in terms of associative arrays, but objects--like Javascript.
Extract Default Values from JSON Schema
Using Default Values
In these examples, $dataset is meant to represent user-provided values, which may need to be filled in with default values. Be sure to heed the argument order for array_replace_recursive().
Relative Path $ref
_definitions.schema.json
foo.schema.json
Relative path references as shown above in foo.schema.json for the title property, are resolved based on the second argument to ValidateWithSchema:
As you might expect these are equivalent:
Install with Composer
-
Because this is an unpublished package, you must define it's repository in your project's composer.json file. Add the following to composer.json in the
repositoriesarray: - Require this package:
All versions of json-schema-validation with dependencies
opis/json-schema Version ^2.3
ext-json Version *
aklump/default-value Version ^0.0