-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when trying to use cast and coerce #321
Comments
I had the same problem. I solved it by using: use \JsonSchema\Constraints\Constraint;
use \JsonSchema\Constraints\Factory;
use \JsonSchema\Validator;
$validator = new Validator(new Factory(
null,
null,
Constraint::CHECK_MODE_TYPE_CAST | Constraint::CHECK_MODE_COERCE
)); |
@iongion where in the docs did you find this example? i remember a PR around |
This PR syncs the readme with the code, but it also changes the API a bit: Comments welcome. |
@steffkes I mentioned it is on the github home repo page, that is where I took it from, now I see the factory, which is good! 👍 |
Using json-schema 4.0, for this code that respects documentation on github repo home page:
The error is:
I've noticed now it expects a factory, how can it be solved as I have no clue on how to pass the factory
The text was updated successfully, but these errors were encountered: