Skip to content

Release 1.0.0

Compare
Choose a tag to compare
@danielaparker danielaparker released this 31 Dec 17:00
· 415 commits to master since this release
  • API Changes

    • Non-const basic_json::operator[const string_view_type& key] no longer
      returns a proxy type. The rationale for this change is given in Git Issue
      #315. The new behavior for the non-const overload of operator[](const string_view_type& key) is to return a reference to the value that is
      associated with key, inserting a default constructed value with the key
      if no such key already exists, which is consistent with the standard
      library std::map behavior. The new behavior for the const overload of
      operator[](const string_view_type& key) is to return a const reference
      to the value that is associated with key, returning a const reference to
      a default constructed value with static storage duration if no such key
      already exists.

    • Until 1.0.0, a buffer of text is supplied to basic_json_parser with a
      call to update() followed by a call to parse_some(). Once the parser
      reaches the end of the buffer, additional JSON text can be supplied to the
      parser with another call to update(), followed by another call to
      parse_some(). See Incremental parsing (until
      1.0.0)
      .
      Since 0.179, an initial buffer of text is supplied to the parse with a
      call to set_buffer, and parsing commences with a call to parse_some.
      The parser can be constructed with a user provided chunk reader to obtain
      additional JSON text as needed. See Incremental parsing (since
      1.0.0)
      .

    • enum bigint_chars_format is deprecated and replaced by
      bignum_format_kind. Added bignum_format getter and setter functions
      to basic_json_options, and deprecated bigint_format getter and setter
      functions. Changed default bignum_format from
      bigint_chars_format::base10 to bignum_format_kind::raw. Rationale:
      bigint_chars_format was misnamed, as it applied to bigdec as well as
      bigint numbers, and defaulting to bigint_chars_format::base10 produced
      surprising results for users of our lossless number option.

    • The URI argument passed to the jsonschema ResolveURI function object now
      included the fragment part of the URI.

  • Fixed bugs:

    • Git Issue #554: [jsonpath] evaluation throws on json containing json_const_pointer

    • Git PR #560: [jmespath] When there are elements and the sum is indeed zero, avg function should return average value returned instead of a null value.

    • Git Issue #561: json_string_reader does not work correctly for empty string or string with all blanks

    • Git Issue #564: Fixed basic_json compare of double and non-numeric string

    • Git Issue #570: Fixed writing fixed number of map value/value pairs using cbor_encoder and msgpack_encoder

    • Fixed a number of issues in uri::resolve, used in jsonschema, related to abnormal references,
      particulay ones containing dots in path segments.

  • Removed deprecated classes and functions:

    • The jsonschema function make_schema, classes json_validator and validation_output,
      header file json_validator.hpp and example legacy_jsonschema_examples.cpp,
      deprecated in 0.174.0, have been removed.
  • Enhancements:

    • Added stream output operator (<<) to uri class.

    • Added basic_json(json_pointer_arg_t, basic_json* j) constructor to
      allow a basic_json value to contain a non-owning view of another basic_json
      value.

    • Added constant null_arg so that a null json value can be
      constructed with

        json j{jsoncons::null_arg};
    
    • Custom jmespath functions are now supported thanks to PR #560

    • jsonschema now understands the 'uri' and 'uri-reference' formats