Improves exception handling throughout the RootedJsonData class:
When basic json_decode() fails, throws an \InvalidArgumentException() (better practice than simple \Exception) and includes the json_decode error message.
Passes the actual Opis\JsonSchema\Exception\InvalidSchemaException() when a schema is rejected rather than catching and replacing with simple \Exception.
Provides a new ValidationException() class to catch validation errors from Opis and pass them along in a validationResult property.
There is an argument to be made that we should not be so reliant on exceptions and other classes from a dependency (Opis and JsonPath) but the reality is that our library is pretty thin, we're just providing integration between these two libraries anyway
Improves exception handling throughout the RootedJsonData class:
json_decode()
fails, throws an\InvalidArgumentException()
(better practice than simple\Exception
) and includes the json_decode error message.Opis\JsonSchema\Exception\InvalidSchemaException()
when a schema is rejected rather than catching and replacing with simple\Exception
.ValidationException()
class to catch validation errors from Opis and pass them along in avalidationResult
property.There is an argument to be made that we should not be so reliant on exceptions and other classes from a dependency (Opis and JsonPath) but the reality is that our library is pretty thin, we're just providing integration between these two libraries anyway