Releases: danielaparker/jsoncons
Release 0.119.1
Bug fix:
Fixed issue wjson dump() not formatting booleans correctly #174
Release 0.119.0
Name change:
- The name
json_staj_readerhas been deprecated and renamed tojson_pull_reader
Bug fix:
- Fixed a bug in json function
empty()when type isbyte_string. - Fixed a bug with preserving semantic_tag_type when copying json values of long string type.
Changes:
-
Removed deprecated feature
cbor_view -
CBOR decimal fraction and bigfloat string formatting now consistent with double string formatting
Enhancements:
-
json
to_string()andto_double()now work with CBOR bigfloat -
JSONPath operators in filter expressions now work with
big_integer,big_decimal, andbig_float
tagged json values -
json
is_number()function now returnstrueif string value is tagged withbig_integeror
big_decimal, or if array value is tagged withbig_float. -
json
as_string()function now converts arrays tagged withbig_floatto decimal strings -
json
as_double()function now converts arrays tagged withbig_floatto double values
Name change: -
The name
json_staj_readerhas been deprecated and renamed tojson_pull_reader
Bug fix:
- Fixed a bug in json function
empty()when type isbyte_string. - Fixed a bug with preserving semantic_tag_type when copying json values of long string type.
Changes:
-
Removed deprecated feature
cbor_view -
CBOR decimal fraction and bigfloat string formatting now consistent with double string formatting
Enhancements:
-
json
to_string()andto_double()now work with CBOR bigfloat -
JSONPath operators in filter expressions now work with
big_integer,big_decimal, andbig_float
tagged json values -
json
is_number()function now returnstrueif string value is tagged withbig_integeror
big_decimal, or if array value is tagged withbig_float. -
json
as_string()function now converts arrays tagged withbig_floatto decimal strings -
json
as_double()function now converts arrays tagged withbig_floatto double values
Release 0.118.0
Name change
- The
json_optionsnamedec_to_strhas been deprecated and renamed tolossless_number.
New features
-
New csv option
lossless_number. If set totrue, parse numbers with exponent and fractional parts as strings with
semantic taggingsemantic_tag_type::big_decimal(instead of double.) Defaults tofalse. -
A class
jsonpointer::addresshas been introduced to make it simpler to construct JSON Pointer addresses
Release 0.117.0
Deprecated features:
- cbor_view has been deprecated. Rationale: The complexity of supporting and documenting this component
exceeded its benefits.
New features
-
New
json_optionsoptiondec_to_str. If set totrue, parse decimal numbers as strings with
semantic taggingsemantic_tag_type::big_decimalinstead of double. Defaults tofalse. -
The
ojson(order preserving) implementation now has an index to support binary search
for retrieval. -
Added
std::string_viewdetection -
jsoncons-CBOR semantic tagging supported for CBOR tags 32 (uri)
Name changes (non-breaking)
- The json options name
bignum_chars_formathas been deprecated and replaced withbig_integer_chars_format. big_integer_chars_format::integer(bignum_chars_format::integer) has been deprecated and replaced with
big_integer_chars_format::number- The
json_options functionbignum_formathas been deprecated and replaced withbig_integer_format
Changes to floating-point printing
-
If the platform supports the IEEE 754 standard, jsoncons now uses the Grisu3 algorithm for printing floating-point numbers,
falling back to a safe method using C library functions for the estimated 0.5% of floating-point numbers that might be rejected by Grisu3.
The Grisu3 implementation follows Florian Loitsch's grisu3_59_56
implementation. If the platform does not support the IEEE 754 standard, the fall back method is used. -
In previous versions, jsoncons preserved information about the format, precision, and decimal places
of the floating-point numbers that it read, and used that information when printing them. With the
current strategy, that information is no longer needed. Consequently, thefloating_point_options
parameter in thedo_double_valueanddouble_valuefunctions of the SAX-style interface have
been removed. -
The
jsonfunctionsprecision()anddecimal_places()have been deprecated and return 0
(as this information is no longer preserved.) -
The constructor
json(double val, uint8_t precision)has been deprecated. -
Note that it is still possible to set precision as a json option when serializing.
Release 0.116.0
New features:
-
New jsonpath functions
keysandtokenize. -
jsoncons-CBOR data item mappings supported for CBOR tags 33 (string base64url) and 34 (string base64)
Release 0.115.0
New features:
-
bson UTC datetime associated with jsoncons
semantic_tag_type::timestamp -
New traits class
is_json_type_traits_implthat addresses issues
#133 and
#115 (duplicates) -
Following a proposal from soberich, jsonpath functions on JSONPath expressions
are no longer restricted to filter expressions. -
New jsonpath functions
sum,count,avg, andprodhave been added. -
Added
semantic_tag_type::base16,semantic_tag_type::base64,semantic_tag_type::base64url
Non-breaking changes:
-
The json constructor that takes a
byte_stringand abyte_string_chars_format
has been deprecated, use asemantic_tag_typeto supply an encoding hint for a byte string, if any. -
The content handler
byte_string_valuefunction that takes abyte_stringand abyte_string_chars_format
has been deprecated, use asemantic_tag_typeto supply an encoding hint for a byte string, if any.
Changes:
- The
byte_string_chars_formatparameter in the content handlerdo_byte_string_valuefunction
has been removed, thesemantic_tag_typeparameter is now used to supply an encoding hint for a byte string, if any.
Release 0.114.0
Bug fixes:
-
On Windows platforms, fixed issue with macro expansion of max when
including windows.h (also in 0.113.1) -
Fixed compile issue with
j = json::make_array()(also in 0.113.2)
Breaking changes to jsoncons semantic tag type names:
- semantic_tag_type::bignum to semantic_tag_type::big_integer
- semantic_tag_type::decimal_fraction to semantic_tag_type::big_decimal
- semantic_tag_type::epoch_time to semantic_tag_type::timestamp
Non-breaking name changes:
The following names have been deprecated and renamed (old names still work)
-
bignum_valuetobig_integer_valueinjson_content_handler -
decimal_valuetobig_decimal_valueinjson_content_handler -
epoch_time_valuetotimestamp_valueinjson_content_handler -
cbor_bytes_serializertocbor_buffer_serializer -
msgpack_bytes_serializertomsgpack_buffer_serializer -
json_serializing_optionstojson_options -
csv_serializing_optionstocsv_options -
parse_errortoserialization_error
The rationale for renaming parse_error to serialization_error
is that we need to use error category codes for serializer
errors as well as parser errors, so we need a more general name
for the exception type.
Message Pack enhancements
-
New
msgpack_serializerthat supports Message Pack bin formats -
New
msgpack_parserthat supports Message Pack bin formats -
encode_msgpackanddecode_msgpackhave been
rewritten usingmsgpack_serializerandmsgpack_parser,
and also now support bin formats.
New features:
-
decode from and encode to the Universal Binary JSON Specification (ubjson) data format
-
decode from and encode to the Binary JSON (bson) data format
-
The cbor, msgpack and ubjson streaming serializers now validate that the expected number of
items have been supplied in an object or array of pre-determined length.
Release 0.113.2
Bug fix
- On Windows platforms, fixed issue with macro expansion of max when
including windows.h
Release 0.113.1
Bug fix
Fixed compile issue with j = json::make_array().
Release 0.113.0
Bug fix
- Fixed issue with indefinite length byte strings, text strings, arrays,
and maps nested inside other CBOR items (wasn't advancing the
input pointer past the "break" indicator.)
Changes
-
FILE and LINE macros removed from JSONCONS_ASSERT
if not defined _DEBUG (contributed by zhskyy.) -
semantic_tag_type name
decimalchanged todecimal_fraction
New CBOR feature
-
CBOR semantic tagging of expected conversion of byte strings
to base64, base64url and base16 are preserved and respected in JSON
serialization (unless overridden injson_serializing_options.) -
CBOR semantic tagging of bigfloat preserved with
semantic_tag_type::bigfloat -
CBOR non text string keys converted to strings when decoding
to json values
Changes to json_serializing_options
New options
- spaces_around_colon (defaults to
space_after) - spaces_around_comma (defaults to
space_after) - pad_inside_object_braces (defaults to
false) - pad_inside_array_brackets (defaults to
false) - line_length_limit (defaults to '120`)
- new_line_chars (for json serialization, defaults to
\n)
nan_replacement, pos_inf_replacement, and neg_inf_replacement are deprecated (still work)
These have been replaced by
- nan_to_num/nan_to_str
- inf_to_num/inf_to_str
- neginf_to_num/neginf_to_str (default is
-followed by inf_to_num/inf_to_str)
nan_to_str, inf_to_str and neginf_to_str are also used to substitute back to nan, inf and neginf in the parser.
-
Long since deprecated options
array_array_block_option,
array_object_block_option,object_object_block_optionand
object_array_block_optionhave been removed. -
The names
object_array_split_lines,object_object_split_lines,
array_array_split_linesandarray_object_split_lineshave
been deprecated (still work) and renamed toobject_array_line_splits,
object_object_line_splits,array_array_line_splitsandarray_object_line_splits.
Rationale: consistency withline_split_kindname.
Changes to json_serializer
-
Previously the constructor of
json_serializertook an optional argument to
indicate whether "indenting" was on.json_serializernow always produces
indented output, so this argument has been removed. -
A new class
json_compressed_serializerproduces compressed json without
indenting.The jsoncons functions that perform serialization including
json::dump,
pretty_printand the output stream operator are unaffected.