Releases: danielaparker/jsoncons
Release 1.4.3
Release 1.4.2
-
Fixed bug:
- Git PR #638: Fixed issue with compiling with
-fno_exceptions
- Git PR #638: Fixed issue with compiling with
Release 1.4.1
This patch fixes some issues reported with v1.4.0
-
Fixed bug:
- Git PR #628: fixed uninitialized warning
- Git Issue #631: Using std::variant with std::unordered_map can throw uncatchable exception
- Git PR #633: Fix make_array() call
- Git Issue #634: Regression in encode_json et al. from v1.3.2 to v1.4.0 with std::variant using std::map
- Git Issue #635: Support construction of sorted_json_object from moved-in pairs
Release 1.4.0
-
Fixed bug:
-
Enhancements:
-
Use
std::from_charsfor 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_optionsmemberlossless_bignum. Iftrue, reads out of range floating point numbers
as strings with tagsemantic_tag::bigdec. Defaults to true. -
New reflection trait definitions,
jsoncons::reflect::json_conv_traits, that support non-throwing conversions and uses-allocator construction.
These replacejsoncons::json_type_traits, but for backwards compatibility,json_conv_traitsdefaults tojson_type_traitsif a type conversion is undefined. -
New non-throwing versions of the decode functions that return a
std::expected-like result (likestd::expected<T,jsoncons::read_error>),try_decode_jsontry_decode_csvtry_decode_bsontry_decode_cbortry_decode_msgpacktry_decode_ubjson
-
New non-throwing versions of the encode functions that return a
std::expected-like result (likestd::expected<void,jsoncons::write_error>),try_encode_jsontry_encode_csvtry_encode_bsontry_encode_cbortry_encode_msgpacktry_encode_ubjson
-
New non-throwing accessor
try_as<T>()forbasic_jsonthat return astd::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_sethelper functionscombine_allocatorsandtemp_allocator_onlyhave been
deprecated and will be removed in a future release. Usemake_alloc_setinstead. -
The
jsoncons::csv::result_options::valueoption 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. Usejsoncons::csv::result_options{}instead. -
basic_json::dumpandencode_jsonoverloads that take ajsoncons::indentingargument have been
deprecated and will be removed in a future release. Use the_prettyoverloads (introduced in 0.155.0)
for prettified output (line indentation.)
-
-
Breaking change to staj iterator classes
- Classes
staj_array_viewandstaj_object_viewand corresponding factoriesstaj_array
andstaj_objecthave been removed. staj_array_iteratorandstaj_object_iteratorobjects are now constructed directly
from a cursor rather than through one of these view objects.- Classes
staj_array_iteratorandstaj_object_iteratornow havebeginandend
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) { // ... } - Classes
Release 1.3.2
-
Fixed bug:
- Git Issue #607: Fixed issue with
staj_object_viewandstaj_array_viewiterators that got introduced
as a consequence of a change in 1.3.1
- Git Issue #607: Fixed issue with
Release 1.3.1
-
Fixed bugs:
-
Git Issue #601: Removed the space before the suffix in the user-defined literal operators
_jsonand_ojson -
Git Issue #605: Fixed bug when parsing a JMESPath expression that has a function that is passed a binary expression argument, e.g. A || B.
-
In cursors, after a call to
read_tofollowing abegin_objectevent, the cursorevent_type()function returned
staj_event_type::begin_object, even though the effective state of the cursor had changed tostaj_event_type::end_object.
This is fixed. The state of the cursor after a call tonextis the same as before. -
Fixed an edge case in
basic_csv_parser, detected by Google fuzz, where the first line in the input file contains an empty line
and thecsv_mapping_kindisn_rows.
-
-
API Changes:
-
In JMESPath evaluation, 1.3.0 introduced late binding of variables to an initial (global) scope via parameters.
The parameters type has been changed fromstd::vector<std::pair<string_type,Json>>tostd::map<string_type,Json>. -
Added a member function
begin_position()toser_context.begin_position()should
be preferred toposition()when using filters to update JSON in place.
Currently the two accessors return the same value, but that may change in a future release. -
Added macros JSONCONS_VISITOR_RETURN_TYPE and JSONCONS_VISITOR_RETURN that are
#define'd toboolandreturn truerespectively. For users that have implemented
classes that derive frombasic_json_filter, and that have overriddenvisit_xxxfunctions,
it is recommended to use these macros for the return type and return value rather than
boolandreturn true. This is for forward compatibility.
-
Release 1.3.0
-
Fixed bugs:
-
Git Issue #600: Added "-Wnull-dereference" to CI and worked around some false positives.
-
Git Issue #597: Invalid json schema compiled successfully
-
Git Issue #595: SIGABRT when serialising unmapped enum value
-
Fixed a jmespath issue with parenthesized expressions involving projections (wildcard expressions,
the flatten operator, slices and filter expressions) where the right parenthesis did not stop the projection.
For example, given JSON{"foo" : [[0, 1], [2, 3]]}, the JMESPath query(foo[*])[0]
returned[0,2]rather than the correct[0,1]. -
Fixed a
json_encoderformatting issue whenarray_object_line_splitsoption set toline_split_kind::same_line.
-
-
Implemented new features:
-
JMESPath Lexical Scoping using the new let expression
-
JMESPath evaluation now supports late binding of variables to an initial (global) scope
via parameters. -
New
json_optionsmembersallow_commentsandallow_trailing_comma. These options should
be preferred over using an error handler.
-
Release 1.2.0
-
Fixed bugs:
- Git Issue #453: jsonpath length function with recursive select argument gives wrong result
-
Implemented new features:
-
Git issue #556: Support nested JSON to CSV. Add
flat,column_mapping, andmax_nesting_depthoptions tobasic_csv_options -
Git issue #585: Add
raw_tag()accessor tobasic_cbor_cursor. Add functionsbegin_object_with_tag,
begin_array_with_tag,uint64_value_with_tagetc. tobasic_cbor_encoderto support encoding values with
raw CBOR tags. -
Git issue #574: Support custom JSON Schema error messages with
errorMessagekeyword. Add
enable_custom_error_messageoption toevaluation_options.
-
Release 1.1.0
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
-