Releases: danielaparker/jsoncons
Release 0.99.8.2
0.99.8.2
New features
- Added
json
functionspush_back
andinsert
for appending values
to the end of ajson
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
supportsstd::valarray
Documentation
- Documentation is now in the repository itself. Please see the documentation
link in the README.md file
Changed
- Removed
CharT
template parameter fromjson_stream_traits
Release 0.99.8
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 use
string_value(value,context),
integer_value(value,context),
uinteger_value(value,context),
double_value(value,precision,context),
bool_value(value,context)and
null_value(context)` -
json_output_handler
overloaded functions value(value)have been deprecated. Instead use
string_value(value),
integer_value(value),
uinteger_value(value),
double_value(value,precision=0),
bool_value(value)and
null_value(context)` -
For consistency, the names
jsoncons_ext/msgpack/message_pack.hpp
,
encode_message_pack
anddecode_message_pack
have been deprecated and
replaced withjsoncons_ext/msgpack/msgpack.hpp
,encode_msgpack
anddecode_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
andas
functions. 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_query
now supports returning normalized paths (with
optionalreturn_type::path
parameter) -
New jsonpath
max
andmin
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
-
json_type_traits
supportsstd::pair
(convert to/from json array of size 2) -
parse_stream
renamed toparse
(backwards compatible) -
kvp_type
renamed tokey_value_pair_type
(backwards compatible) -
The
_json
and_ojson
literal 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
owjson
has been deprecated (still works) and changed towojson
. Rationale: naming consistency -
Added json array functions
emplace_back
andemplace
, 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_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 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_encoder
introduced 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::object
as 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_stream
has been renamed towrite
, 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 tojson
- A new template parameter,
JsonTraits
, has been added to thebasic_json
class template. - New instantiations of
basic_json
,ojson
andwojson
, 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()
tojson
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
-
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
- 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_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