Skip to content

Releases: danielaparker/jsoncons

Release 0.99.8.2

30 Aug 16:18
Compare
Choose a tag to compare

0.99.8.2

New features

  • Added json functions push_back and insert for appending values
    to the end of a json array and inserting values at a specifed position

Rationale: While these functions provide the same functionality as the existing
json::add function, they have the advantage of following the naming conventions
of the C++ library, and have been given prominence in the examples and documentation
(add is still supported.)

0.99.8.1

New features

  • cbor extension supports encoding to and decoding from the cbor binary serialization format.

  • json_type_traits supports std::valarray

Documentation

  • Documentation is now in the repository itself. Please see the documentation
    link in the README.md file

Changed

  • Removed CharT template parameter from json_stream_traits

Release 0.99.8

15 Aug 17:39
Compare
Choose a tag to compare

Changes

  • Visual Studio 2013 is no longer supported (jsonpath uses string initilizer lists)

  • json_input_handler overloaded functions value(value,context)have been deprecated. Instead usestring_value(value,context), integer_value(value,context), uinteger_value(value,context), double_value(value,precision,context), bool_value(value,context)andnull_value(context)`

  • json_output_handler overloaded functions value(value)have been deprecated. Instead usestring_value(value), integer_value(value), uinteger_value(value), double_value(value,precision=0), bool_value(value)andnull_value(context)`

  • For consistency, the names jsoncons_ext/msgpack/message_pack.hpp,
    encode_message_pack and decode_message_pack have been deprecated and
    replaced with jsoncons_ext/msgpack/msgpack.hpp, encode_msgpack and decode_msg_pack

Bug fixes

  • Fixed operator== throws when comparing a string against an empty object

  • Fixed jsonpath issue with array 'length' (a.length worked but not a['length'])

  • msgpack extension uses intrinsics for determing whether to swap bytes

New features

  • Stream supported C++ values directly to JSON output, governed by json_stream_traits

  • json::is() and json::as() accept template packs, which they forward to the
    json_type_traits is and as functions. This allows user defined json_type_traits
    implementations to resolve, for instance, a name into a C++ object looked up from a
    registry. See Type Extensibility, Example 2.

  • jsonpath json_query now supports returning normalized paths (with
    optional return_type::path parameter)

  • New jsonpath max and min aggregate functions over numeric values

  • New json::merge function that inserts another json object's key-value pairs
    into a json object, if they don't already exist.

  • New json::merge_or_update function that inserts another json object's key-value
    pairs into a json object, or assigns them if they already exist.

Release 0.99.7.3

24 Jul 02:24
Compare
Choose a tag to compare
  • json_type_traits supports std::pair (convert to/from json array of size 2)

  • parse_stream renamed to parse (backwards compatible)

  • kvp_type renamed to key_value_pair_type (backwards compatible)

  • The _json and _ojson literal operators have been moved to the namespace jsoncons::literals.
    Access to these literals now requires

    using namespace jsoncons::literals;    

Rationale: avoid name clashes with other json libraries

  • The name owjson has been deprecated (still works) and changed to wojson. Rationale: naming consistency

  • Added json array functions emplace_back and emplace, and json object functions try_emplace
    and insert_or_assign, which are analagous to the standard library vector and map functions.

Release 0.99.7.2

21 Feb 14:50
Compare
Choose a tag to compare

Bug fix

  • A bug was introduced in 0.99.7 causing the values of existing object members to not be changed with set or assignment operations. This has been fixed.

Change

  • jsoncons_ext/binary changed to jsoncons_ext/msgpack
  • namespace jsoncons::binary changed to jsoncons::msgpack

Release 0.99.7.1

24 Jan 05:15
Compare
Choose a tag to compare

0.99.7.1


  • Workarounds in unicode_traits and jsonpath to maintain support for vs2013
  • Added mapping_type::n_rows, mapping_type::n_objects, and mapping_type::m_columns options for csv to json

0.99.7

Bug fixes

  • Issues with precedence in JsonPath filter evaluations have been fixed
  • An issue with (a - expression) in JsonPath filter evaluations has been fixed

New feature

  • The new binary extension supports encoding to and decoding from the MessagePack binary serialization format.
  • An extension to JsonPath to allow filter expressions over a single object.
  • Added support for * and / operators to jsonpath filter
  • literal operators _json and _ojson have been introduced

Non-breaking changes

  • The json write functions have been renamed to dump. The old names have been deprecated but still work.
  • Support for stateful allocators
  • json function object_range() now returns a pair of RandomAccessIterator (previously BidirectionalIterator)
  • json operator [size_t i] applied to a json object now returns the ith object (previously threw)

Breaking change (if you've implemented your own input and output handlers)

In basic_json_input_handler, the virtual functions

virtual void do_name(const CharT* value, size_t length, 
                     const basic_parsing_context<CharT>& context)

virtual void do_string_value(const CharT* value, size_t length, 
                             const basic_parsing_context<CharT>& context)

have been changed to

virtual void do_name(string_view_type val, 
                     const basic_parsing_context<CharT>& context) 

virtual void do_string_value(string_view_type val, 
                             const basic_parsing_context<CharT>& context) 

In basic_json_output_handler, the virtual functions

virtual void do_name(const CharT* value, size_t length) 

virtual void do_string_value(const CharT* value, size_t length) 

have been changed to

virtual void do_name(string_view_type val)

virtual void do_string_value(string_view_type val)

Removed features:

  • The jsonx extension has been removed

Release 0.99.5

17 Nov 02:08
Compare
Choose a tag to compare
  • Validations added to utf8 and utf16 string parsing to pass all JSONTestSuite tests
  • The name json_encoder introduced in 0.99.4 has been changed to json_decoder. Rationale: consistencty with common usage (encoding and serialization, decoding and deserialization)

Release 0.99.3a

30 Sep 13:21
Compare
Choose a tag to compare

0.99.3a

Changes

The json initializer-list constructor has been removed, it gives inconsistent results when an initializer has zero elements, or one element of the type being initialized (json). Please replace

json j = {1,2,3} with json j = json::array{1,2,3}, and

json j = {{1,2,3},{4,5,6}} with json j = json::array{json::array{1,2,3},json::array{4,5,6}}

  • Initializer-list constructors are now supported in json::object as well as json::array, e.g.
json j = json::object{{"first",1},{"second",json::array{1,2,3}}};
  • json::any has been deprecated and will be removed in the future
  • The json method to_stream has been renamed to write, the old name is still supported.
  • output_format object_array_block_option, array_array_block_option functions have been deprecated and replaced by
    object_array_split_lines, array_array_split_lines functions.

Enhancements

  • A new method get_with_default, with return type that of the default, has been added to json
  • A new template parameter, JsonTraits, has been added to the basic_json class template.
  • New instantiations of basic_json, ojson and wojson, have been added for users who wish to preserve the alphabetical sort of parsed json text and to insert new members in arbitrary name order.
  • Added support for json is<T>, as<T>, constructor, and assignment operator for any sequence container (std::array, std::vector, std::deque, std::forward_list, std::list) whose values are assignable to JSON types (e.g., ints, doubles, bools, strings, STL containers of same) and for associative containers (std::set, std::multiset, std::unordered_set, std::unordered_multiset.)
  • Added static method null() to json class to return null value
  • A new extension jsonx that supports serializing JSON values to JSONx (XML)
  • json parser will skip bom in input if present

Fixes:

  • Fixes to the jsonpath extension, including the union operator and applying index operations to string values
  • Fixes to remove warnings and issues reported by VS2015 with 4-th warnings level, PVS-Studio static analyzer tool, and UBSAN.

Release 0.99.2

05 Jul 17:16
Compare
Choose a tag to compare
  • Included workaround for a C++11 issue in GCC 4.8, contributed by Alex Merry

  • Fixed operator== so that json() == json(json::object())

  • Fixed issue with json assignment to initializer list

  • Fixed issue with assignment to empty json object with multiple keys, e.g.

    json val;
    val["key1"]["key2"] = 1;

Release 0.99.1

09 May 16:34
Compare
Choose a tag to compare
  • Fix to json_filter class
  • Fix to readme_examples

Release 0.99

27 Apr 18:53
Compare
Choose a tag to compare
  • Fixes to deprecated json parse functions (deprecated, but still supposed to work)
  • The Visual C++ specific implementation for reading floating point numbers should have freed a _locale_t object, fixed
  • Added json_type_traits specialization to support assignment from non-const strings
  • When parsing fractional numbers in text, floating point number precision is retained, and made available to serialization to preserve round-trip. The default output precision has been changed from 15 to 16.
  • Added json std::initializer_list constructor for constructing arrays
  • The deprecated json member constants null, an_object, and an_array have been removed
  • Microsoft VC++ versions earlier than 2013 are no longer supported