Releases: danielaparker/jsoncons
Release 0.99.8
Changes
-
Visual Studio 2013 is no longer supported (jsonpath uses string initilizer lists)
-
json_input_handleroverloaded 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_handleroverloaded 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_packanddecode_message_packhave been deprecated and
replaced withjsoncons_ext/msgpack/msgpack.hpp,encode_msgpackanddecode_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'])
-
msgpackextension 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_traitsisandasfunctions. This allows user definedjson_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_querynow supports returning normalized paths (with
optionalreturn_type::pathparameter) -
New jsonpath
maxandminaggregate functions over numeric values -
New
json::mergefunction that inserts another json object's key-value pairs
into a json object, if they don't already exist. -
New
json::merge_or_updatefunction 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
-
json_type_traitssupportsstd::pair(convert to/from json array of size 2) -
parse_streamrenamed toparse(backwards compatible) -
kvp_typerenamed tokey_value_pair_type(backwards compatible) -
The
_jsonand_ojsonliteral operators have been moved to the namespacejsoncons::literals.
Access to these literals now requires
using namespace jsoncons::literals; Rationale: avoid name clashes with other json libraries
-
The name
owjsonhas been deprecated (still works) and changed towojson. Rationale: naming consistency -
Added json array functions
emplace_backandemplace, and json object functionstry_emplace
andinsert_or_assign, which are analagous to the standard library vector and map functions.
Release 0.99.7.2
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
0.99.7.1
- Workarounds in unicode_traits and jsonpath to maintain support for vs2013
- Added
mapping_type::n_rows,mapping_type::n_objects, andmapping_type::m_columnsoptions 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
jsonwritefunctions have been renamed todump. 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
- Validations added to utf8 and utf16 string parsing to pass all JSONTestSuite tests
- The name
json_encoderintroduced in 0.99.4 has been changed tojson_decoder. Rationale: consistencty with common usage (encoding and serialization, decoding and deserialization)
Release 0.99.3a
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::objectas well asjson::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_streamhas been renamed towrite, the old name is still supported. output_formatobject_array_block_option,array_array_block_optionfunctions have been deprecated and replaced by
object_array_split_lines,array_array_split_linesfunctions.
Enhancements
- A new method
get_with_default, with return type that of the default, has been added tojson - A new template parameter,
JsonTraits, has been added to thebasic_jsonclass template. - New instantiations of
basic_json,ojsonandwojson, 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
jsonis<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()tojsonclass to return null value - A new extension jsonx that supports serializing JSON values to JSONx (XML)
- json parser will skip
bomin input if present
Fixes:
- Fixes to the
jsonpathextension, 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
-
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
jsonassignment 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
- Fix to json_filter class
- Fix to readme_examples
Release 0.99
- 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_tobject, fixed - Added
json_type_traitsspecialization 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_listconstructor 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
Release 0.98.4.1
Includes fixes contributed by massimomorara for g++ "4.9.2"