Releases: danielaparker/jsoncons
Release 1.5.0
-
Fixed bugs:
-
Git Issue #644: flatten/unflatten does not preserve arrays with more than 10 elements
-
Git Issue #652: Fixed issue with JSON Schema AdditionalProperties validator
-
Git Issue #653: Fixed issue with non existing default values being added in JSON Schema patch
-
Git Issue #659: Fixed jsonschema validation message
-
Git Issue #664: Fixed issue with detection of CBOR typed arrays that manifested itself on i386
-
Fixed issue with JSON encode option
array_array_split_linesvalueline_split_kind::new_line
not creating a new line -
Fixed issue of JSON encode line split options applied to inner JSON structures
conflicting with line split options applied to outer JSON structures, e.g. when
root line splits are same_line and array within array line splits are multi_line.
With the new behaviour the inner structure will remain same_line if the outer
structure is same_line.
-
-
Changes
-
jsonpointer::unflattennow throws an exception if passed an empty object -
The
err_handlerproperty ofbasic_json_optionshas been deprecated and will
be removed in a future release. Use theallow_trailing_commaandallow_comments
options instead. -
Constructor overloads for
basic_json_parser,basic_json_reader,basic_json_cursor,
basic_csv_parser,basic_csv_readerandbasic_csv_cursorthat take anerr_handler
argument have been deprecated and will be removed in a future release. Use the
allow_trailing_commaandallow_commentsoptions instead. -
The functors
strict_json_parsingandallow_trailing_commashave been deprecated and
will be removed in a future release. Use theallow_trailing_commaandallow_comments
options instead. -
The json_parser option
lossless_bignum, when false, now applies to integer values
as well as floating point values. -
basic_json::is_bignumfunction has been changed to returntrueif the value
is any string value tagged asbigint,bigdec,float128, orbigfloat
(previously onlybigint.) -
basic_jsonhas a functiontype()that returns ajson_typeenumeration,
and the names of its enumerators have been changed.null_value,bool_value,
int64_value,uint64_value,half_value,double_value,string_value,
byte_string_value,array_valueandobject_valuehave been changed to
null,boolean,int64,uint64,float16,float64,string,
byte_string,arrayandobjectrespectively. It's unlikely that we have
many users ofjson_type, it isn't used in any of our examples, but for
backwards compatibility the old names, now deprecated, have been typedef-ed to
the new names. -
The
json_optionsmember nameline_splitshas been renamed toroot_line_spits.
For backwards compatibility, the old name, now deprecated, behaves the same as the
new name.
-
-
Enhancements
-
Git Discussions #594: Updated reflection traits to supports
boost::optional -
Git Discussions #651: Improved
decode_jsonerror messages -
Git PR #647: Allow user configuration of JSONCONS_HAS_STD_FROM_CHARS
-
Git Discussions #654: Added an
indent_charproperty tobasic_json_optionsthat supports tab indents -
Git Discussions #660: Added reflection traits for read/write of enum values as integers.
-
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.
-