Releases: danielaparker/jsoncons
Release 0.150.0
Defects fixed:
-
Fixed jsonpath issue union with spaces
-
Fixed jsonpath issue Bracket notation with empty string
-
Fixed jsonpath issue Bracket notation with empty string doubled quoted
Changes:
-
The names
basic_json_content_handlerandbasic_default_json_content_handler
have been deprecated and renamed tobasic_json_visitorandbasic_default_json_visitor.
The private visitor functionsdo_xxxhave been renamed tovisit_xxx.
This change should be transparent to most users. -
The name
staj_event_type::namehas been deprecated and renamed to
staj_event_type::key. Rationale: consistency with other names. The old
name is still supported. -
The class
null_ser_contexthas been deprecated. For defaults,ser_context()
is now used in place ofnull_ser_context().
Enhancements:
- Added jsonpointer
unflattenfunction
Release 0.149.0
Defects fixed:
- Fixed vs issue (since v0.148.0) with basic_json constructor disambiguation with
a combination of type tag andstd::initializer_listarguments.
Non-breaking change:
- For consistency with naming conventions across
json_type_traitsconvenience macros,
macro names containingGETTER_CTORnow containCTOR_GETTER, e.g.
JSONCONS_ALL_GETTER_CTOR_NAME_TRAITSis nowJSONCONS_ALL_CTOR_GETTER_NAME_TRAITS.
The old names are still supported.
Enhancements:
- Added jsonpath functions
flattenandunflattenthat 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
Changes:
-
The
json_type_traitsconvenience macro names ending inNAMED_TRAITS
have been deprecated and now end inNAME_TRAITS, e.g. the old name
JSONCONS_ALL_GETTER_SETTER_NAMED_TRAITSis nowJSONCONS_ALL_GETTER_SETTER_NAME_TRAITS.
Rationale: name consistency. -
Fixed some deprecated
json_type_traitsconvenience macro names. All
of the convenience macro names that have ever been deprecated should work.
Enhancements:
- Added overload with leading
temp_allocator_arg_tparameter toencode_json,encode_bson,encode_csv,
encode_cbor,encode_msgpackandencode_ubjson, which allows the user to supply a custom allocator
that serialization will use for temporary work areas.
Release 0.147.0
Fixed bugs:
- Fixed an issue with the
jsonpatch_errorclass implementation ofwhat(), likely related to
issue #212
Enhancements:
-
Added support to the convenience macros
JSONCONS_N_GETTER_CTOR_TRAITSandJSONCONS_ALL_GETTER_CTOR_NAMED_TRAITSfor-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
flattento flatten a json object or array into a single depth object of JSONPointer-value pairs. -
Added overload with leading
temp_allocator_arg_tparameter todecode_json,decode_bson,decode_csv,
decode_cbor,decode_msgpackanddecode_ubjson, which allows the user to supply a custom allocator
that deserialization will use for temporary work areas.
Release 0.146.1
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
Changes:
-
The name
rename_object_member_filterhas been deprecated and renamed to
rename_object_key_filter -
The
json_content_handlerpublic functionnamehas been deprecated and renamed tokey.
Rationale: in the future we'll likely support overloads for non-string keys for binary formats -
The
json_content_handlerprivate virtual functiondo_namehas been removed and replaced withdo_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>forTthat is not a polymorphic class,
i.e., does not have any virtual functions -
New json_type_traits specialization for
std::unique_ptr<T>forTthat is not a polymorphic class -
For the
_N_convenience macros that allow some non-mandatory members, the generated
traitsto_jsonfunction will exclude altogether empty values forstd::shared_ptr
andstd::unique_ptrnon-mandatory members, as they do currently forstd::optional.
Release 0.145.2
v0.145.2
Defect fixes:
- Fixed issue with
json_type_traitsspecialization for optional
v0.145.1
Bug fixes:
- Fixed issue with jsoncons::optional
v0.145.0
Bug fixes:
Name changes:
- The
json_type_traitsconvenience macro names ending in_DECLhave been shortened
by dropping the_DECLsuffix, e.g. the old nameJSONCONS_N_MEMBER_TRAITS_DECLis now
JSONCONS_N_MEMBER_TRAITS. The old names are still supported.
Enhancements:
-
Includes
json_type_traitsspecialization forstd::optionalif C++ 17.nulloptvalues
are mapped to JSON null values. -
When encoding to JSON, the
json_type_traitsconvenience macros will exlude altogether a non-mandatory
std::optionalnulloptvalue from the JSON output.
Release 0.144.0
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
Bug fix:
- Fixed bug in destructor of
typed_arrayclass
Enhancement:
- Improved performance of decoding CBOR typed arrays
Release 0.143.1
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_traitsspecialization for integer keyed maps, with conversion
to/from string keys in abasic_json. -
The
json_type_traitsspecializations for typeTgenerated by the convenience macros now include a specialization of
is_json_type_traits_declared<T>with member constantvalueequaltrue. -
New
basic_jsonmember functionjson_type type() -
New
basic_jsonmember functionget_value_orthat gets a value as typeTif 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 toat_or_null(name). Rationale:get_with_default(name)
is more likeat(name)(both return a const reference) than
get_with_default(name,default_value)(which returns a value.) -
The tag type
bstr_arg_thas been renamed tobyte_string_arg_t, and the constant
bstr_argtobyte_string_arg. -
The
cbor_content_handlerpublic member functionstyped_array()and private virtual functions
do_typed_array()have been moved tobasic_json_content_handler. Thedo_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::spanis available
(primarily for typed array interface.)