Json schema spec says URLs are validated as per RFC-3986, but PHP's
FILTER_VALIDATE_URL can't cope with relative path references, which are
explicitly allowed. See https://tools.ietf.org/html/rfc3986#section-4.2
for further information.
* Add option to apply default values from the schema
* Clone default objects instead of passing by reference
Objects should always be assigned via clone, to prevent modifications
to the input object from also modifying the underlying schema.
* Run php-cs-fixer
* Remove two duplicate test cases
* Add option to throw an exception on validation errors
* Update README
* Changes API references to use the new Validator::validate() entry point
* Adds section describing available config options
This commit makes the following changes:
* Split the Constraint class to make Validator independent from it
* Add Validator::validate() as the main entry point
* Turn Validator::coerce() and Validator::check() into aliases
* Add Factory::setConfig(), getConfig(), addConfig() & removeConfig()
* Make type-coercion a checkMode option, don't pass $coerce everywhere
* Add some extra tests
* add support for type coercion
* add tests
* move coerce tests out of base
* use flags for mode
* update readme
* fix tests
* remove ws
* use binary literals, explicit cast
* back to hex
Currently, if a property has multiple valid types, an error message
when a value doesn't conform to the schema, would mention only the
last valid type, without mentioning the other valid types.
This commit changes, how the TypeConstraint works internally. It
does a little bit of refactoring (removing also the "Refacter this"
ToDo) and now mentions any valid types on a failure.
Fixes#293
description for failing tests. Flatten directory structure
Use "test.json / suite description / test case description" notation in data provider to allow a readable test output
Skip Draft3Test / Draft4Test tests which are not passing
Add some comment to skipped tests
RFC3339 allows for second fractions to be any length, however PHP's
date/time formatting ALWAYS prints them out as 6 digits. This means if a
date-time is passed with a < 6 digit second fractional, the
FormatConstraint::validateDateTime will fail as the formatted date will
contain 6 digits.
E.g. '2000-05-01T12:12:12.123Z' is passed as a date time and is valid.
However after parsing, format() will produce
'2000-05-01T12:12:12:12.123000Z'.
Fixes issue #145.