Skip to content

Releases: sburba/strict-json

Version 2.0.0

17 Apr 23:47
6903103
Compare
Choose a tag to compare

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

Version 1.1.0

14 Apr 05:12
8512a09
Compare
Choose a tag to compare

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

12 Apr 02:43
4063948
Compare
Choose a tag to compare

Improve documentation for public StrictJson methods

Fix an issue with parsing null json values for nullable parameters

Version 1.0.2

11 Apr 00:43
4068adf
Compare
Choose a tag to compare
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

10 Apr 02:28
693c560
Compare
Choose a tag to compare
Merge pull request #4 from sburba/feature/better-error-messages

Feature/better error messages

Version 1.0

09 Apr 15:32
1760b13
Compare
Choose a tag to compare

Initial Release