Skip to content

Release 1.4.0

Choose a tag to compare

@danielaparker danielaparker released this 27 Aug 02:57
· 276 commits to master since this release
  • Fixed bug:

    • Git PR #628: fixed uninitialized warning

    • Git Issue #622: fixed jmespath issue with uri resolution in patternProperties

    • Git Issue #620: Issue with JSONPath filter expression fixed through PR #621

  • Enhancements:

    • Use std::from_chars for chars to double conversion when supported in GCC and VC.
      This reverts the removal of this feature in 0.170.0, because of issue std::from_chars parsing fails tests on Windows.
      That issue has been addressed.

    • New basic_json_options member lossless_bignum. If true, reads out of range floating point numbers
      as strings with tag semantic_tag::bigdec. Defaults to true.

    • New reflection trait definitions, jsoncons::reflect::json_conv_traits, that support non-throwing conversions and uses-allocator construction.
      These replace jsoncons::json_type_traits, but for backwards compatibility, json_conv_traits defaults to json_type_traits if a type conversion is undefined.

    • New non-throwing versions of the decode functions that return a std::expected-like result (like std::expected<T,jsoncons::read_error>),

      • try_decode_json
      • try_decode_csv
      • try_decode_bson
      • try_decode_cbor
      • try_decode_msgpack
      • try_decode_ubjson
    • New non-throwing versions of the encode functions that return a std::expected-like result (like std::expected<void,jsoncons::write_error>),

      • try_encode_json
      • try_encode_csv
      • try_encode_bson
      • try_encode_cbor
      • try_encode_msgpack
      • try_encode_ubjson
    • New non-throwing accessor try_as<T>() for basic_json that return a std::expected<T,conversion_error>-like result,

  • Changes

    • Until now, the reflection traits generated by the convenience macros JSONCONS_ALL_MEMBER_TRAITS
      etc. produced JSON (or other formats) with object names in sorted order. After this release,
      they will produce JSON, BSON etc. with object names in the order that they appear as macro arguments.

    • The allocator_set helper functions combine_allocators and temp_allocator_only have been
      deprecated and will be removed in a future release. Use make_alloc_set instead.

    • The jsoncons::csv::result_options::value option has been deprecated and will be removed in a
      future release. See What does result_options::value do in json_query()?
      for the rationale for this change. Use jsoncons::csv::result_options{} instead.

    • basic_json::dump and encode_json overloads that take a jsoncons::indenting argument have been
      deprecated and will be removed in a future release. Use the _pretty overloads (introduced in 0.155.0)
      for prettified output (line indentation.)

  • Breaking change to staj iterator classes

    • Classes staj_array_view and staj_object_view and corresponding factories staj_array
      and staj_object have been removed.
    • staj_array_iterator and staj_object_iterator objects are now constructed directly
      from a cursor rather than through one of these view objects.
    • Classes staj_array_iterator and staj_object_iterator now have begin and end
      non-member functions for range-based for loop support.

    We don't expect this change will affect many users. In any case the change is simple, e.g.

      auto view = staj_object<std::string,json>(cursor);
      for (const auto& key_val : view)
      {
          // ...
      }
    

    becomes

      auto iter = staj_object_iterator<std::string,json>(cursor);
      for (const auto& key_val : iter)
      {
          // ...
      }