Skip to content

Releases: danielaparker/jsoncons

Release 0.164.0

28 May 12:46

Choose a tag to compare

Changes to jsonpath:

  • The values in the result_options bitmask have been changed from

    enum class result_options {value=1, path=2, nodups=4|path, sort=8|path}; (until 0.164.0)

to

enum class result_options {value=0, nodups=1, sort=2, path=4};            (since 0.164.0)

In practice this means that any combination of these values that includes
result_options::value has the same meaning as before, except that
result_options::value can now be omitted. And any combination that includes
result_options::path but not result_options::value has the
same meaning as before.

Enhancements to jsonpath:

  • Functions now allow expressions to be passed as arguments, e.g.

    $.books[?(ceil(@.price*100) == 2272)]

  • User provided custom functions are now supported

Changes to json_reader and csv_reader:

  • The typedefs json_reader and wjson_reader have been deprecated,
    but for backwards compatibility they are still supported. They
    have been replaced by json_string_reader and wjson_string_reader
    for string sources, and json_stream_reader and wjson_stream_reader,
    for stream sources.

  • The typedefs csv_reader and wcsv_reader have been deprecated,
    but for backwards compatibility they are still supported. They
    have been replaced by csv_string_reader and wcsv_string_reader
    for string sources, and csv_stream_reader and wcsv_stream_reader,
    for stream sources.

Release 0.163.3

23 Apr 10:34

Choose a tag to compare

Bugs fixed:

  • Fixed a jsonpath issue where the two overloads of json_query and json_replace
    that took a callback function argument used a deprecated typedef in an
    SFINAE condition.

Release 0.163.2

09 Apr 15:31

Choose a tag to compare

Bugs fixed:

  • Fixed a jmespath issue with reusing compiled expressions, see #317

Release 0.163.1

07 Apr 10:17

Choose a tag to compare

Bugs fixed:

  • Reversed change made in 0.163.0 to removal of duplicates with the result_options::nodups,
    reverting to previous behaviour (only consider as duplicates nodes with the exact same path
    starting from the root.) That seems to be the consensus.

  • Fixed a memory leak in jsoncons::jsonpath::node_set, see #314,
    also related, #316

  • Fixed some gcc warnings about non-virtual destructors in the jsonpath, jmespath, and
    jsonschema extensions by making the destructors protected, see #313.
    Added the gcc compiler flag -Wnon-virtual-dtor for gcc in the tests/CMakeLists.txt file.

Release 0.163.0

20 Mar 23:35

Choose a tag to compare

Bugs fixed:

  • Fixed a jsonpath issue with removal of duplicates with the result_options::nodups flag in the case of a union with different paths

Release 0.162.3

20 Mar 02:10

Choose a tag to compare

  • Fixed a sign-compare warning in android builds

Release 0.162.2

13 Mar 00:52

Choose a tag to compare

  • Fixed a sign-compare warning

Release 0.162.1

20 Feb 22:52

Choose a tag to compare

Release 0.162.0

15 Feb 01:14

Choose a tag to compare

Enhancements to jsonpointer

  • The jsonpointer functions get, add, add_if_absent, and replace
    have an additonal overload with a create_if_missing parameter. If
    passed true, creates key-object pairs when object keys are missing.

Enhancements to jsonpath

  • Improved syntax checking for JSONPath unions
  • Simplified function signatures for make_expression, json_query, and json_replace.

Changes:

  • The jsonpointer function insert has been deprecated and renamed to add_if_absent,
    for consistency with the other names.

Release 0.161.0

08 Feb 15:04

Choose a tag to compare

The jsoncons::jsonpath extension has been rewritten, see JSONPath extension revisited.

Enhancements to JSONPath extension

  • Added a new function make_expression for creating a compiled JSONPath expression for later evaluation.
  • The json_query and json_replace functions now take an optional result_options parameter that allows duplicate values (i.e. values with
    the same node paths) to be excluded from results, and for results to be sorted in path order.

Changes to json_query

  • The parameter result_type has been replaced by a bitmask type result_options.
    For backwards compatability, result_type has been typedefed to result_options,
    and the value and path enumerators are still there. In addition, result_options
    provides options for excluding duplicates from results, and for results to be sorted in
    path order.

  • Until 0.161.0, json_query was limited to returning an array of results, a copy.
    With 0.161, json_query allows the user to provide a binary callback
    that is passed two arguments - the path of the item and a const reference to the
    original item.

  • Until 0.161.0, json_replace allowed the user to provide a unary callback to replace
    an item in the original JSON with a returned value. This overload is still there, but has
    been deprecated. With 0.161, json_replace allows the user to provide a binary callback
    that is passed two arguments - the path of the item and a mutable reference to the
    original item.

Changes to supported JSONPath syntax

  • Previous versions allowed optionally omitting the '$' representing the root of the
    JSON instance in path selectors. This is no longer allowed. In 0.161.0, all path
    selectors must start with either '$', if relative to the root of the JSON instance,
    or '@', if relative to the current node. E.g. store.book.0 is not allowed,
    rather, $store.book.0.
  • Previous versions supported union of completely separate paths, e.g.
    $..[name.first,address.city]. 0.161.0 does too, but requires that the
    relative paths name.first and address.city start with a '@', so the
    example becomes $..[@.name.first,@.address.city] .
  • Previous versions supported unquoted names with the square bracket notation,
    this is no longer allowed. E.g. $[books] is not allowed, rather $['books']
    or $["books"].
  • Previous versions allowed an empty string to be passed as a path argument
    to json_query. This is no longer allowed, a syntax error will be raised.
  • In 0.161.0, unquoted names in the dot notation are restricted to digits 0-9,
    letters A-Z and a-z, the underscore character _, and unicode coded characters
    that are non-ascii. All others names must be enclosed with single or double quotes.
    In particular, names with hypens (-) must be enclosed with single or double quotes.

Enhancements to JMESPath extension

  • Function arity errors are now raised during compilation of the JMESPath expression
    rather than during evaluation.