Skip to content

Release 0.113.0

Choose a tag to compare

@danielaparker danielaparker released this 20 Nov 22:31
· 8584 commits to master since this release

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.