jsv4-php
jsv4-php copied to clipboard
A (coercive) JSON Schema v4 Validator for PHP
Hi, Here is my json schema: "image": { "type": "string", "pattern": "^((http://|https://)?(www)?)+(\.?([\w/]))+\.?([\w])+?$" }, but when I input data like: { "image": "htt://www.example.com/1.jpg" } It always validates to be TRUE. So...
It would be helpful to put all error messages on a separate file. So to translate them we only need to create a new file with the translations and pass...
The file composer.json require yourself if execute it's the result it is Using version ^1.0 for geraintluff/jsv4 ./composer.json has been updated Root package 'geraintluff/jsv4' cannot require itself in its composer.json...
1. Use `property_exists` for object checking 2. Coercive type hinting `(object) $this->data` for array value in object schema type, and `(array) $this->data` for array schema type. 3. Coerce scalar values...
Hi, I am having an issue while using the coerce functionality. I'm using the coerce functionality in order to add properties to my JSON object according to schema. The issue...
Cleanup
It's sad that this nice library has a bit outdated structure and styling. I restructured the files and refactored the code to better comply to psr-2 coding style guide. Tests...
EDIT: The methods isValid() and validate() actually expect both the $data and the $schema parameter to be json. This should perhaps be stated in readme.md!? The example below works with...
Currently if a field's value is `null`, the `Validator::checkTypes` method does not pass. This patch allows a `null` value when the field's schema does not have `required: true` set.
I would consider it best-practice to not drag along unwanted properties the client might send. At the same time a strict API rejecting the whole json might not what best...
[] syntax is invalid in some PHP configurations.