Skip to content

Releases: danielaparker/jsoncons

Release 0.119.0

27 Feb 05:22
Compare
Choose a tag to compare

Name change:

  • The name json_staj_reader has been deprecated and renamed to json_pull_reader

Bug fix:

  • Fixed a bug in json function empty() when type is byte_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() and to_double() now work with CBOR bigfloat

  • JSONPath operators in filter expressions now work with big_integer, big_decimal, and big_float
    tagged json values

  • json is_number() function now returns true if string value is tagged with big_integer or
    big_decimal, or if array value is tagged with big_float.

  • json as_string() function now converts arrays tagged with big_float to decimal strings

  • json as_double() function now converts arrays tagged with big_float to double values
    Name change:

  • The name json_staj_reader has been deprecated and renamed to json_pull_reader

Bug fix:

  • Fixed a bug in json function empty() when type is byte_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() and to_double() now work with CBOR bigfloat

  • JSONPath operators in filter expressions now work with big_integer, big_decimal, and big_float
    tagged json values

  • json is_number() function now returns true if string value is tagged with big_integer or
    big_decimal, or if array value is tagged with big_float.

  • json as_string() function now converts arrays tagged with big_float to decimal strings

  • json as_double() function now converts arrays tagged with big_float to double values

Release 0.118.0

30 Jan 22:56
Compare
Choose a tag to compare

Name change

  • The json_options name dec_to_str has been deprecated and renamed to lossless_number.

New features

  • New csv option lossless_number. If set to true, parse numbers with exponent and fractional parts as strings with
    semantic tagging semantic_tag_type::big_decimal (instead of double.) Defaults to false.

  • A class jsonpointer::address has been introduced to make it simpler to construct JSON Pointer addresses

Release 0.117.0

18 Jan 05:24
Compare
Choose a tag to compare

Deprecated features:

  • cbor_view has been deprecated. Rationale: The complexity of supporting and documenting this component
    exceeded its benefits.

New features

  • New json_options option dec_to_str. If set to true, parse decimal numbers as strings with
    semantic tagging semantic_tag_type::big_decimal instead of double. Defaults to false.

  • 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 with big_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 with big_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, the floating_point_options
    parameter in the do_double_value and double_value functions of the SAX-style interface have
    been removed.

  • The json functions precision() and decimal_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

06 Jan 23:30
Compare
Choose a tag to compare

New features:

  • New jsonpath functions keys and tokenize.

  • jsoncons-CBOR data item mappings supported for CBOR tags 33 (string base64url) and 34 (string base64)

Release 0.115.0

30 Dec 14:19
Compare
Choose a tag to compare

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, and prod 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 a byte_string_chars_format
    has been deprecated, use a semantic_tag_type to supply an encoding hint for a byte string, if any.

  • The content handler byte_string_value function that takes a byte_string and a byte_string_chars_format
    has been deprecated, use a semantic_tag_type to supply an encoding hint for a byte string, if any.

Changes:

  • The byte_string_chars_format parameter in the content handler do_byte_string_value function
    has been removed, the semantic_tag_type parameter is now used to supply an encoding hint for a byte string, if any.

Release 0.114.0

14 Dec 20:13
Compare
Choose a tag to compare

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 to big_integer_value in json_content_handler

  • decimal_value to big_decimal_value in json_content_handler

  • epoch_time_value to timestamp_value in json_content_handler

  • cbor_bytes_serializer to cbor_buffer_serializer

  • msgpack_bytes_serializer to msgpack_buffer_serializer

  • json_serializing_options to json_options

  • csv_serializing_options to csv_options

  • parse_error to serialization_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 and decode_msgpack have been
    rewritten using msgpack_serializer and msgpack_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

29 Nov 16:16
Compare
Choose a tag to compare

Bug fix

  • On Windows platforms, fixed issue with macro expansion of max when
    including windows.h

Release 0.113.1

27 Nov 02:12
Compare
Choose a tag to compare

Bug fix

Fixed compile issue with j = json::make_array().

Release 0.113.0

20 Nov 22:31
Compare
Choose a tag to compare

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 to decimal_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 in json_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 and array_object_split_lines have
    been deprecated (still work) and renamed to object_array_line_splits,
    object_object_line_splits, array_array_line_splits and array_object_line_splits.
    Rationale: consistency with line_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

11 Nov 19:03
Compare
Choose a tag to compare

Changes to json_content_handler

  • The function byte_string_value no longer supports passing a byte string as

    handler.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 with json_staj_reader.

  • The name stream_event_type has been deprecated and replaced with staj_event_type

  • The names basic_stream_event (stream_event) have been deprecated and replaced with basic_staj_event (staj_event)

  • The names basic_stream_filter (stream_filter) have been deprecated and replaced with basic_staj_filter (staj_filter)
    (staj stands for "streaming API for JSON, analagous to StAX in XML)

  • The json_parser function end_parse has been deprecated and replaced with finish_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 from json_content_handler