Skip to content

Releases: danielaparker/jsoncons

Release 0.150.0

03 Apr 23:27

Choose a tag to compare

Defects fixed:

Changes:

  • The names basic_json_content_handler and basic_default_json_content_handler
    have been deprecated and renamed to basic_json_visitor and basic_default_json_visitor.
    The private visitor functions do_xxx have been renamed to visit_xxx.
    This change should be transparent to most users.

  • The name staj_event_type::name has been deprecated and renamed to
    staj_event_type::key. Rationale: consistency with other names. The old
    name is still supported.

  • The class null_ser_context has been deprecated. For defaults, ser_context()
    is now used in place of null_ser_context().

Enhancements:

  • Added jsonpointer unflatten function

Release 0.149.0

24 Mar 22:10

Choose a tag to compare

Defects fixed:

  • Fixed vs issue (since v0.148.0) with basic_json constructor disambiguation with
    a combination of type tag and std::initializer_list arguments.

Non-breaking change:

  • For consistency with naming conventions across json_type_traits convenience macros,
    macro names containing GETTER_CTOR now contain CTOR_GETTER, e.g.
    JSONCONS_ALL_GETTER_CTOR_NAME_TRAITS is now JSONCONS_ALL_CTOR_GETTER_NAME_TRAITS.
    The old names are still supported.

Enhancements:

  • Added jsonpath functions flatten and unflatten that flatten a json object or array
    to a single depth object of key-value pairs, and unflatten that object back to the original json.

Release 0.148.0

16 Mar 15:52

Choose a tag to compare

Changes:

  • The json_type_traits convenience macro names ending in NAMED_TRAITS
    have been deprecated and now end in NAME_TRAITS, e.g. the old name
    JSONCONS_ALL_GETTER_SETTER_NAMED_TRAITS is now JSONCONS_ALL_GETTER_SETTER_NAME_TRAITS.
    Rationale: name consistency.

  • Fixed some deprecated json_type_traits convenience macro names. All
    of the convenience macro names that have ever been deprecated should work.

Enhancements:

  • Added overload with leading temp_allocator_arg_t parameter to encode_json, encode_bson, encode_csv,
    encode_cbor, encode_msgpack and encode_ubjson, which allows the user to supply a custom allocator
    that serialization will use for temporary work areas.

Release 0.147.0

08 Mar 12:39

Choose a tag to compare

Fixed bugs:

  • Fixed an issue with the jsonpatch_error class implementation of what(), likely related to
    issue #212

Enhancements:

  • Added support to the convenience macros JSONCONS_N_GETTER_CTOR_TRAITS and JSONCONS_ALL_GETTER_CTOR_NAMED_TRAITS for-non mandatory members to be omitted altogether from the serialized JSON. These macros had been overlooked when this feature was added to the _N_ macros in v0.146.0.

  • Added jsonpointer function flatten to flatten a json object or array into a single depth object of JSONPointer-value pairs.

  • Added overload with leading temp_allocator_arg_t parameter to decode_json, decode_bson, decode_csv,
    decode_cbor, decode_msgpack and decode_ubjson, which allows the user to supply a custom allocator
    that deserialization will use for temporary work areas.

Release 0.146.1

28 Feb 11:31

Choose a tag to compare

Fixed issue with json_type_traits specializations of std::shared_ptr<T> and
std::unique_ptr<T> when converting from JSON null.

Release 0.146.0

28 Feb 02:15

Choose a tag to compare

Changes:

  • The name rename_object_member_filter has been deprecated and renamed to
    rename_object_key_filter

  • The json_content_handler public function name has been deprecated and renamed to key.
    Rationale: in the future we'll likely support overloads for non-string keys for binary formats

  • The json_content_handler private virtual function do_name has been removed and replaced with do_key.
    Rationale: in the future we'll likely support overloads for non-string keys for binary formats

Enhancements:

  • New json_type_traits specialization for std::shared_ptr<T> for T that is not a polymorphic class,
    i.e., does not have any virtual functions

  • New json_type_traits specialization for std::unique_ptr<T> for T that is not a polymorphic class

  • For the _N_ convenience macros that allow some non-mandatory members, the generated
    traits to_json function will exclude altogether empty values for std::shared_ptr
    and std::unique_ptr non-mandatory members, as they do currently for std::optional.

Release 0.145.2

25 Feb 15:56

Choose a tag to compare

v0.145.2

Defect fixes:

  • Fixed issue with json_type_traits specialization for optional

v0.145.1

Bug fixes:

  • Fixed issue with jsoncons::optional

v0.145.0

Bug fixes:

Name changes:

  • The json_type_traits convenience macro names ending in _DECL have been shortened
    by dropping the _DECL suffix, e.g. the old name JSONCONS_N_MEMBER_TRAITS_DECL is now
    JSONCONS_N_MEMBER_TRAITS. The old names are still supported.

Enhancements:

  • Includes json_type_traits specialization for std::optional if C++ 17. nullopt values
    are mapped to JSON null values.

  • When encoding to JSON, the json_type_traits convenience macros will exlude altogether a non-mandatory
    std::optional nullopt value from the JSON output.

Release 0.144.0

28 Jan 17:11

Choose a tag to compare

Bug fixes:

Fixed issue json with preserve_order_policy does not preserve order of elements #210

Implemented feature requests:

  • 208 Added member function to basic_json
template <class T>
T as(byte_string_arg_t, semantic_tag hint) const; 

Release 0.143.2

09 Jan 07:08

Choose a tag to compare

Bug fix:

  • Fixed bug in destructor of typed_array class

Enhancement:

  • Improved performance of decoding CBOR typed arrays

Release 0.143.1

03 Jan 02:03

Choose a tag to compare

Bug fix:

  • v0.143.1 fixs a bug in the jsonpath filter < comparison operator that was introduced in v0.143.0

Enhancements:

  • j.as<int>(), j.as<uint64_t>() etc. supported for binary, octal and hex string values,
    in addition to decimal string values.

  • Includes json_type_traits specialization for integer keyed maps, with conversion
    to/from string keys in a basic_json.

  • The json_type_traits specializations for type T generated by the convenience macros now include a specialization of
    is_json_type_traits_declared<T> with member constant value equal true.

  • New basic_json member function json_type type()

  • New basic_json member function get_value_or that gets a value as type T if available,
    or a default value if not:

    template <class T,class U>
    T get_value_or(const string_view_type& name, U&& default_value) const;

get_value_or is the preferred alternative to

template<class T>
T get_with_default(const string_view_type& name, const T& default_value) const

Note that get_value_or requires that the first template parameter T be specified explicitly (unlike get_with_default)

Changes:

  • The basic_json get_with_default(name) function, which returned a const reference
    to the value if available and to a json null constant if not,
    has been deprecated and renamed to at_or_null(name). Rationale: get_with_default(name)
    is more like at(name) (both return a const reference) than
    get_with_default(name,default_value) (which returns a value.)

  • The tag type bstr_arg_t has been renamed to byte_string_arg_t, and the constant
    bstr_arg to byte_string_arg.

  • The cbor_content_handler public member functions typed_array() and private virtual functions
    do_typed_array() have been moved to basic_json_content_handler. The do_typed_array()
    private virtual functions have been given default implementations. cbor_content_handler
    has been deprecated.

  • Replaced Martin Moene's span-lite with simpler implementation until std::span is available
    (primarily for typed array interface.)