Releases: danielaparker/jsoncons
Release 1.0.0
-
API Changes
-
Non-const
basic_json::operator[const string_view_type& key]no longer
returns a proxy type. The rationale for this change is given in Git Issue
#315. The new behavior for the non-const overload ofoperator[](const string_view_type& key)is to return a reference to the value that is
associated withkey, inserting a default constructed value with the key
if no such key already exists, which is consistent with the standard
librarystd::mapbehavior. The new behavior for the const overload of
operator[](const string_view_type& key)is to return a const reference
to the value that is associated withkey, returning a const reference to
a default constructed value with static storage duration if no such key
already exists. -
Until 1.0.0, a buffer of text is supplied to
basic_json_parserwith a
call toupdate()followed by a call toparse_some(). Once the parser
reaches the end of the buffer, additional JSON text can be supplied to the
parser with another call toupdate(), followed by another call to
parse_some(). See Incremental parsing (until
1.0.0).
Since 0.179, an initial buffer of text is supplied to the parse with a
call toset_buffer, and parsing commences with a call toparse_some.
The parser can be constructed with a user provided chunk reader to obtain
additional JSON text as needed. See Incremental parsing (since
1.0.0). -
enum
bigint_chars_formatis deprecated and replaced by
bignum_format_kind. Addedbignum_formatgetter and setter functions
tobasic_json_options, and deprecatedbigint_formatgetter and setter
functions. Changed defaultbignum_formatfrom
bigint_chars_format::base10tobignum_format_kind::raw. Rationale:
bigint_chars_formatwas misnamed, as it applied tobigdecas well as
bigintnumbers, and defaulting tobigint_chars_format::base10produced
surprising results for users of our lossless number option. -
The URI argument passed to the jsonschema ResolveURI function object now
included the fragment part of the URI.
-
-
Fixed bugs:
-
Git Issue #554: [jsonpath] evaluation throws on json containing json_const_pointer
-
Git PR #560: [jmespath] When there are elements and the sum is indeed zero, avg function should return average value returned instead of a null value.
-
Git Issue #561: json_string_reader does not work correctly for empty string or string with all blanks
-
Git Issue #564: Fixed basic_json compare of double and non-numeric string
-
Git Issue #570: Fixed writing fixed number of map value/value pairs using cbor_encoder and msgpack_encoder
-
Fixed a number of issues in
uri::resolve, used in jsonschema, related to abnormal references,
particulay ones containing dots in path segments.
-
-
Removed deprecated classes and functions:
- The jsonschema function
make_schema, classesjson_validatorandvalidation_output,
header filejson_validator.hppand examplelegacy_jsonschema_examples.cpp,
deprecated in 0.174.0, have been removed.
- The jsonschema function
-
Enhancements:
-
Added stream output operator (
<<) to uri class. -
Added
basic_json(json_pointer_arg_t, basic_json* j)constructor to
allow abasic_jsonvalue to contain a non-owning view of anotherbasic_json
value. -
Added constant
null_argso that a null json value can be
constructed with
json j{jsoncons::null_arg};-
Custom jmespath functions are now supported thanks to PR #560
-
jsonschema now understands the 'uri' and 'uri-reference' formats
-
Release 0.178.0
Defect fixes:
-
Fixed issue with
jmespath::join functionthrough PR #546 -
Fixed issue with the path for cmake config files through PR #547
-
Related to #539, made the basic_json constructor
basic_json(const Allocator&)
consistent withbasic_json(json_object_arg_t, const Allocator& alloc = Allocator()). -
Related to #539,
basic_jsoncopy construction now applies allocator traitsselect_on_container_copy_construction
to the allocator obtained fromother. For pmr allocators, this gives a default constructed pmr allocator rather
than a copy of the allocator inother.
Enhancements:
-
Improved the implementation of
basic_jsonswap. Previously in some cases it would allocate. -
Improved the implementation of
basic_jsoncopy assignment. Reduced allocations when assigning from array to array and object to
object. -
Documented the rules for
basic_jsonallocators here,
and added numerous tests for conformance to the rules. -
Added missing
basic_jsonconstructor
basic_json(json_array_arg_t,
std::size_t count, const basic_json& value, semantic_tag tag = semantic_tag::none,
const Allocator& alloc = Allocator());
Release 0.177.0
Release 0.176.0
Compiler support
-
Update to Supported compilers
documentation to reflect the compilers that are currently in continuous integration testing. -
Support for some ancient compilers, in particular g++ 4.8 and 4.9, has been dropped.
-
Accepted pr #519 to support build with with llvm-toolset-7 on CentOS 7.
-
We (and users) have seen some compilation errors with tests of
std::scoped_allocator_adaptorusing our sample stateful allocatorFreeListAllocator
in versions of clang predating version 11, and versions of g++ predating version 10. We've therefore excluded these tests when testing with
the older compilers.
Enhancements
basic_jsonnow supports using C++ 17 structured binding, so you can write
for (const auto& [key, value] : j.object_range())
{
std::cout << key << " => " << value << std::endl;
}
jsonschema extension defect fixes:
-
Fixed issue #520 where enabling format validation resulted in a premature abort to validation
-
Addressed issue #521 so that jsonschema now supports big integers
Other defect fixes:
- Resolved #518 about CUDA and int128 and float 128
Release 0.175.0
This release contains two breaking changes to recently added
features.
Change to jsonpath::get function
- The return value for
jsonpath::gethas been changed from a
pointer to the selected JSON value, or null if not found, to a
std::pair<Json*,bool>, where the bool component indicates
whether the get operation succeeded.
Change to new jsonschema classes and functions introduced in 0.174.0:
- The overload of
json_schema<Json>::validatethat takes a callback
must now be passed a lambda that returnswalk_result::advanceor
walk_result::abort. This supports early exit from validation.
Note that this change does not affect the legacy pre-0.174.0 jsonschema
classes and functions (make_schema, json_validator).
Enhancement to jsonschema library:
- New
json_schemamember functionwalkfor walking through the schema.
Release 0.174.0
Defect fixes:
- Fixed issue #499 with
nan_to_str,inf_to_strandneginf_to_str
Core library enhancements
- New
json_optionsline_splitsoption that addresses issue #490
jsonpath library enhancements
- New function
jsonpath::replaceanalagous tojsonpointer::replace,
but for normalized paths.
jsonschema library enhancements
-
The jsonschema extension now supports Drafts 4, 6, 2019-09 and 2020-12
in addition to Draft 07.-
New function
make_json_schemathat returns a representation of
a compiled JSON Schema document. -
New class
validation_message -
The legacy function
make_schemaand classesjson_validatorand
validation_outputremain for backward compatibility, but have been
deprecated.
-
Release 0.173.4
Release 0.173.3
Defect fixes:
- Made all member functions of jsoncons::range const
Release 0.173.2
- Removed use of deduced return types in jsonpath extension (C++ 14 feature)
Release 173.1
- Fixed issue #473 about
bigintand-Werror=stringop-overflow