Releases: sburba/strict-json
Releases · sburba/strict-json
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
Version 1.1.0
JsonFormatException
messages now include the path to the JSON element that the error occurred on (See the docs).
Deprecate StrictJson::mapParsed
, add StrictJson::mapDecoded
. They both behave identically, mapDecoded is just a better name. mapParsed
is still supported and will be until v2, but move over to the better name to save yourself trouble when upgrading
A new docs page, with vastly improved docs. https://sburba.github.io/strict-json/
Version 1.0.3
Improve documentation for public StrictJson methods
Fix an issue with parsing null json values for nullable parameters
Version 1.0.2
Merge pull request #8 from sburba/bugfix/throw-on-missing-constructor Throw a useful exception when a target type doesn't have a constructor
Version 1.0.1
Merge pull request #4 from sburba/feature/better-error-messages Feature/better error messages
Version 1.0
Initial Release