Version 2.0.0
New Features:
- Error messages now contain the JSON Path the error occurred at
- Map directly to scalars, arrays
- If the model class throws InvalidArgumentException, it will be re-thrown as JsonFormatException to allow you to add extra validation for your JSON
- Better documentation and error messages in lots of places
Breaking Changes from V1:
- Your adapters now must implement
Burba\StrictJson\Adapter
. - The deprecated
StrictJson::mapParsed
has been removed. UseStrictJson::mapDecoded
instead. - The
$target_type
argument inStrictJson::mapDecoded
now must be of typeBurba\StrictJson\Type
instead of string - The
$context
argument inStrictJson::mapDecoded
is now required - When specifying basic types using the array
$array_item_type
parameter in
StrictJsonBuilder::addParameterArrayAdapter
, you must use the newBurba\StrictJson\Type
class - Exceptions thrown in model constructors are now wrapped