Skip to content

Releases: keboola/php-jsonparser

4.0.0

30 Jul 12:07
83b6de0
Compare
Choose a tag to compare

What's Changed

  • PST-1908 update dependencies and PHP, add phpstan baseline by @novak-ji in #14

New Contributors

Full Changelog: 3.0.0...4.0.0

3.0.0

14 Jan 12:42
a8b9356
Compare
Choose a tag to compare

Changelog

  • Refactored to PHP 7.4, updated packages and project structure (#12, #11).

Fixes an error retrieving header if the data is `[null]`

22 Oct 00:28
Compare
Choose a tag to compare

A NoDataException is thrown if [null] is passed to process() to prevent an error retrieving structure details (headers) for such data. An array of multiple nulls will still fail.

Fix: Arrays of null where data is expected now parses properly

10 Oct 10:45
Compare
Choose a tag to compare

If Struct::autoUpgradeToArray() is enabled, an array of null values would create an arrayOfNULL type in the structure, incompatible with any other array, so no non-null values could appear in such array.

  • Example:

    [
      { "runId": [
          null
      ]},
      { "runId": [
          "value"
      ]}
    ]
    

This array would previously fail as incompatible. Now the first is simply ignored.

Fix an exception on empty data

28 Sep 06:16
Compare
Choose a tag to compare

Throw NoDataException if the data type is unknown and an empty set is passed to Parser::process()

Fixed on the fly analysis in Parser::parse() "spam"

28 Sep 00:11
Compare
Choose a tag to compare
  • Only analyze data in parse() if they're really unknown - less data than what's being parsed

Struct fix

27 Sep 21:51
Compare
Choose a tag to compare
  • fix: Struct::load() now throws a correct exception if the array structure is wrong
  • feat: getArrayType() has moved from Analyzer to Struct and is now public

Major rewrite for better maintainability & bugfixes

27 Sep 10:57
Compare
Choose a tag to compare
  • Removed arrayStringMix, replaced with autoUpgradeToArray, which supports arrays of objects.
  • Added check preventing mixing of scalar and object values in an array.
  • Added Struct and Analyzer classes that take care of the data analysis and storage of structure.
  • Struct::load() now checks integrity of the structure on load
  • Arrays in the Struct now contain their type (eg. arrayOfinteger)
  • In a non-strict mode (default), all scalars are now identified as scalar from their initial analysis, not when a mismatch is encountered.