Releases: danielaparker/jsoncons
Release 0.119.0
Name change:
- The name
json_staj_reader
has 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 returnstrue
if string value is tagged withbig_integer
or
big_decimal
, or if array value is tagged withbig_float
. -
json
as_string()
function now converts arrays tagged withbig_float
to decimal strings -
json
as_double()
function now converts arrays tagged withbig_float
to double values
Name change: -
The name
json_staj_reader
has 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 returnstrue
if string value is tagged withbig_integer
or
big_decimal
, or if array value is tagged withbig_float
. -
json
as_string()
function now converts arrays tagged withbig_float
to decimal strings -
json
as_double()
function now converts arrays tagged withbig_float
to double values
Release 0.118.0
Name change
- The
json_options
namedec_to_str
has 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::address
has 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_options
optiondec_to_str
. If set totrue
, parse decimal numbers as strings with
semantic taggingsemantic_tag_type::big_decimal
instead of double. Defaults tofalse
. -
The
ojson
(order preserving) implementation now has an index to support binary search
for retrieval. -
Added
std::string_view
detection -
jsoncons-CBOR semantic tagging supported for CBOR tags 32 (uri)
Name changes (non-breaking)
- The json options name
bignum_chars_format
has 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 function
bignum_format
has 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_value
anddouble_value
functions of the SAX-style interface have
been removed. -
The
json
functionsprecision()
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
keys
andtokenize
. -
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_impl
that 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
, andprod
have 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_string
and abyte_string_chars_format
has been deprecated, use asemantic_tag_type
to supply an encoding hint for a byte string, if any. -
The content handler
byte_string_value
function that takes abyte_string
and abyte_string_chars_format
has been deprecated, use asemantic_tag_type
to supply an encoding hint for a byte string, if any.
Changes:
- The
byte_string_chars_format
parameter in the content handlerdo_byte_string_value
function
has been removed, thesemantic_tag_type
parameter 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_value
tobig_integer_value
injson_content_handler
-
decimal_value
tobig_decimal_value
injson_content_handler
-
epoch_time_value
totimestamp_value
injson_content_handler
-
cbor_bytes_serializer
tocbor_buffer_serializer
-
msgpack_bytes_serializer
tomsgpack_buffer_serializer
-
json_serializing_options
tojson_options
-
csv_serializing_options
tocsv_options
-
parse_error
toserialization_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_serializer
that supports Message Pack bin formats -
New
msgpack_parser
that supports Message Pack bin formats -
encode_msgpack
anddecode_msgpack
have been
rewritten usingmsgpack_serializer
andmsgpack_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
decimal
changed 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_option
and
object_array_block_option
have been removed. -
The names
object_array_split_lines
,object_object_split_lines
,
array_array_split_lines
andarray_object_split_lines
have
been deprecated (still work) and renamed toobject_array_line_splits
,
object_object_line_splits
,array_array_line_splits
andarray_object_line_splits
.
Rationale: consistency withline_split_kind
name.
Changes to json_serializer
-
Previously the constructor of
json_serializer
took an optional argument to
indicate whether "indenting" was on.json_serializer
now always produces
indented output, so this argument has been removed. -
A new class
json_compressed_serializer
produces compressed json without
indenting.The jsoncons functions that perform serialization including
json::dump
,
pretty_print
and the output stream operator are unaffected.
Release 0.112
Changes to json_content_handler
-
The function
byte_string_value
no longer supports passing a byte string ashandler.byte_string_value({'b','a','r'});
(shown in some of the examples.) Instead use
handler.byte_string_value(byte_string({'b','a','r'}));
(or a pointer to utf8_t data and a size.)
- The function
bignum_value
no longer supports passing a CBOR signum and
byte string,bignum_value
now accepts only a string view. If you
have a CBOR signum and byte string, you can use the bignum class to
convert it into a string.
Name changes (non breaking)
-
The name
json_stream_reader
has been deprecated and replaced withjson_staj_reader
. -
The name
stream_event_type
has been deprecated and replaced withstaj_event_type
-
The names
basic_stream_event
(stream_event
) have been deprecated and replaced withbasic_staj_event
(staj_event
) -
The names
basic_stream_filter
(stream_filter
) have been deprecated and replaced withbasic_staj_filter
(staj_filter
)
(staj stands for "streaming API for JSON, analagous to StAX in XML) -
The
json_parser
functionend_parse
has been deprecated and replaced withfinish_parse
.
Enhancements
-
json double values convert to CBOR float if double to float
round trips. -
csv_parser
ignore_empty_values
option now applies to
m_columns
style json output. -
json_reader and json_staj_reader can be initialized with strings
in addition to streams.
Extension of semantic tags to other values
- The `json_content_handler` functions `do_null_value`, `do_bool_value`,
`do_begin_array` and `do_begin_object` have been given the
semantic_tag_type parameter.
- New tag type `semantic_tag_type::undefined` has been added
- The `cbor_parser` encodes a CBOR undefined tag to a json null
value with a `semantic_tag_type::undefined` tag, and the
`cbor_serializer` maps that combination back to a CBOR undefined tag.
Removed:
- Long since deprecated
value()
functions have been removed fromjson_content_handler