league/json-guard
Unmaintained JSON Schema validator (draft 4) for PHP. Passes the full Draft 4 test suite, supports custom rule sets, and returns helpful errors with JSON Pointers. Consider opis/json-schema or swaggest/php-json-schema as alternatives.
1.0.0 is a complete rewrite. Please review the library and update your code accordingly.
Starting with the 1.0 release json-guard is maintained as two separate packages - a JSON Schema validator implementation and a JSON Reference implementation.
You will need to require both league/json-guard and league/json-reference if you are using JSON references.
id) by default anymore. See the scope resolution documentation for more info.League\JsonGuard\Constraint for more info. If you are using custom constraints you should update them to match the new signature.League\JsonGuard\Constraint\DraftFour namespace.League\JsonGuard\RuleSet\RuleSetContainer to make implementation easier.League\JsonGuard\ValidationError for more info.League\JsonGuard\error function can be used to make building errors easier.ValidationError@getConstraint need to be changed to ValidationError@getContext.ArrayAccess interface for ValidationError you need to replace any usage of the constraints key with context.ValidationError@getCode need to be changed to ValidationError@getKeyword.ArrayAccess interface for ValidationError you need to replace any usage of the code key with keyword.getLoaders method to the Dereferencer which returns all loaders.format would fail when they should pass.$ref were considered a reference by @ribeiropaulorid.A Comparator class was added so that the rest of the code doesn't have to constantly check if bccomp is avaiable. You can specify the precision to use for comparisons by calling Comparator::setScale().
The validator now passes version 1.2.0 of the official test suite.
ErrorCode constants class is now marked as final.json_decode with the option JSON_BIGINT_AS_STRING by default. This allows validating numbers larger than PHP_INT_MAX properly.passes, fails, or errors is called instead of re-validating for each call. This was causing a huge performance hit when validating nested schemas. The properties constraint made two calls which resulted in an exponential slow down for each level of nesting.Ruleset interface now requires throwing a ConstraintNotFoundException instead of returning null for missing constraints.CurlWebLoader.How can I help you explore Laravel packages today?