Skip to content

Version 2.0.0

Compare
Choose a tag to compare
@sburba sburba released this 17 Apr 23:47
· 76 commits to master since this release
6903103

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. Use StrictJson::mapDecoded instead.
  • The $target_type argument in StrictJson::mapDecoded now must be of type Burba\StrictJson\Type instead of string
  • The $context argument in StrictJson::mapDecoded is now required
  • When specifying basic types using the array $array_item_type parameter in
    StrictJsonBuilder::addParameterArrayAdapter, you must use the new Burba\StrictJson\Type class
  • Exceptions thrown in model constructors are now wrapped