* Diagnostic byte positions: A new macro,
JSON_DIAGNOSTIC_POSITIONS, introduces member functions to query
the byte positions of values in the input they were parsed from.
* Enhanced conversion macros: The conversion macros for arbitrary
types now include several upgrades: All macros are templated,
supporting json, ordered_json, and any other basic_json
specialization.
* Derived classes can now be seamlessly converted to/from JSON
using the new NLOHMANN_DEFINE_DERIVED_TYPE_* macros.
* Support for std::optional: The library now supports conversions
from/to std::optional types when compiled with C++17.
* Flexible string compatibility: Functions patch, diff, and
flatten now work with arbitrary string types.
* Binary format enhancements: The BJData mapping now supports
draft 3, including optimized binary array types. The BSON
mapping has added support for unsigned 64-bit integers. The
get_number function used in the binary format implementations
has been optimized to read multiple bytes at once.
* Multidimensional array conversion: Multidimensional C-style
arrays can now be directly converted to JSON.
* Filesystem paths in UTF-8: The conversions from/to
std::filesystem::path are now encoded to UTF-8 strings by
default on all operating systems.
* CMake 4.0 support.
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/nlohmann_json?expand=0&rev=40
- Update to 3.11.1:
* Version 3.11.0 moved the user-defined string literals (UDL)
into namespace nlohmann::literals::json_literals.
Unfortunately, this namespace was not imported to the global
namespace by default which broke code. This release fixes this
bug.
- Update to 3.11.0:
* String view support for all functions working on object keys
(e.g., at or operator[]), avoiding unnecessary allocations.
* BJData as the fifth supported binary format besides BSON, CBOR,
MessagePack, and UBJSON.
* Better C++20 support to make the library integrate more
smoothly with newer codebases.
* Better support for avoiding problems when multiple versions of
the library are used in the same project.
* Even better and more extensive documentation and examples.
* More tests for edge cases like 32-bit support, C++20 features,
using the library with ICPC, or after including <windows.h>.
* Full changelog available at:
https://github.com/nlohmann/json/releases/tag/v3.11.0
OBS-URL: https://build.opensuse.org/request/show/992539
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/nlohmann_json?expand=0&rev=30
- Update to 3.10.5:
* Summary:
+ The previous version 3.10.4 introduced support to convert std::filesystem objects to JSON and vice versa. Unfortunately, we made the assumption that any compiler supporting C++17 would also have proper filesystem support. This was a mistake. This release introduces preprocessor checks (and means to override them) to make sure that the conversion support is only compiled if the compiler is detected to support it.
+ All changes are backward-compatible.
* Bug fixes:
+ Make sure C++17 filesystem conversions are only used if the compiler supports it. Furthermore, add defines JSON_HAS_FILESYSTEM and JSON_HAS_EXPERIMENTAL_FILESYSTEM which can be set to 0 to avoid using filesystem support altogether.std::filesystem. (gh#nlohmann/json#3090, gh#nlohmann/json#3097, gh#nlohmann/json#3156, gh#nlohmann/json#3203)
+ Fix a compilation error with Nvidia CUDA Compiler (NVCC). (gh#nlohmann/json#3013)
+ Fix a warning for shadowed variables. (gh#nlohmann/json#3188)
+ Fix a warning on a pointless comparison. (gh#nlohmann/json#2712, gh#nlohmann/json#2676, gh#nlohmann/json#1390, gh#nlohmann/json#755)
* Improvements:
+ Add a parameter to the update function to recursively merge objects with common keys.
+ Extend std::hash and std::swap to work on any nlohmann::basic_json specializations rather than just nlohmann::json
* Further Changes:
+ Update CI to use Clang 14, GCC 6, and Clang-Tidy 14.
+ Update cpplint.
+ Add build step for the Nvidia CUDA Compiler (NVCC).
+ Remove Travis CI. (gh#nlohmann/json#3087)
+ Compile and execute the test suite with C++17.
+ The mkdocs-based documentation in doc/mkdocs has been totally overworked. It now has a unified structure, more examples, and contains all information from the previous Doxygen-based documentation. The single source of truth is now the documentation on https://json.nlohmann.me and in particular the API Documentation.
+ Removed Wandbox online examples.
+ Fix typos, links, and parameter names in the documentation.
+ Add more examples.
* Deprecated functions:
+ Passing iterator pairs or pointer/length pairs to parsing functions (basic_json::parse, basic_json::accept, basic_json::sax_parse, basic_json::from_cbor, basic_json::from_msgpack, basic_json::from_ubjson, basic_json::from_bson) via initializer lists is deprecated. Instead, pass two iterators; for instance, call basic_json::from_cbor(ptr, ptr+len) instead of basic_json::from_cbor({ptr, len}).
+ The following functions have been deprecated in earlier versions and will be removed in the next major version (i.e., 4.0.0):
- Function iterator_wrapper are deprecated. Please use the member function items() instead.
- Functions friend std::istream& operator<<(basic_json&, std::istream&) and friend std::ostream& operator>>(const basic_json&, std::ostream&) are deprecated. Please use friend std::istream& operator>>(std::istream&, basic_json&) and friend operator<<(std::ostream&, const basic_json&) instead.
+ All deprecations are annotated with HEDLEY_DEPRECATED_FOR to report which function to use instead.
OBS-URL: https://build.opensuse.org/request/show/946820
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/nlohmann_json?expand=0&rev=29
- Update to 3.10.4
- Compiler error in output serializer due to 'incompatible initializer' #3081
- Strange behaviour when using std::sort on std::vector<json> #3080
- Unhandled exception: nlohmann::detail::parse_error #3078
- explicit constructor with default does not compile #3077
- Parse an object but get an array using GCC #3076
- Version 3.10.3 breaks backward-compatibility with 3.10.2 #3070
- Feature request, Add to_json/from_json to align with other to/from binary api. #3067
- vcpkg is out of date #3066
- Revert invalid fix#3082 (nlohmann)
- Allow to use get with explicit constructor #3079 (nlohmann)
- fix std::filesystem::path regression #3073 (theodelrieu)
- Fix Clang version #3040 (nlohmann)
- Fix assertion failure for JSON_DIAGNOSTICS #3037 (carlsmedstad)
- meta: fix is_compatible/constructible traits #3020 (theodelrieu)
- Set parent pointers for values inserted via update() (fixes#3007). #3008 (AnthonyVH)
- Allow allocators for output_vector_adapter #2989 (nlohmann)
- Re-add Clang 12 #2986 (nlohmann)
- Use new Docker image #2981 (nlohmann)
- Fix -Wunused warnings on JSON_DIAGNOSTICS #2976 (gcerretani)
- Update docset generation script #2967 (nlohmann)
Full Changelog: https://github.com/nlohmann/json/compare/v3.10.3...3.10.4
- Changes from 3.10.3
- Parsing an emtpy string returns a string with size 1 instead of expected 0 #3057
- Linking error duplicate symbol: std::type_info::operator== on static build with MinGW #3042
- Yet another assertion failure when inserting into arrays with JSON_DIAGNOSTICS set #3032
- accept and parse function not work well with a pure number string #3029
- push_back doesn't work for serializing containers #3027
- Strange behaviour when creating array with single element #3025
- Input ordered_json doesn't work #3023
- Issue iterating through 'items' #3021
- Cannot spell the namespace right #3015
- JSON Parse error when reading json object from file #3011
- Parent pointer not properly set when using update() #3007
- Overwriting terminated null character #3001
- 'operator =' is ambiguous on VS2017 #2997
- JSON Patch for Array Elements #2994
- JSON Parse throwing error #2983
- to_{binary format} does not provide a mechanism for specifying a custom allocator for the returned type. #2982
- 3.10.1 zip json.hpp has version number 3.10.0 instead of 3.10.1 #2973
- Assertion failure when serializing array with JSON_DIAGNOSTICS set #2926
Full Changelog: https://github.com/nlohmann/json/compare/v3.10.2...v3.10.3
OBS-URL: https://build.opensuse.org/request/show/936182
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/nlohmann_json?expand=0&rev=28
- Add gcc10-fix.patch in order to fix build with GCC 10.
- Update to version 3.7.3:
Bug Fixes
* Removed reserve() calls from the destructor which
could lead to quadratic complexity.
#1837#1838 fire Deprecated functions
This release does not deprecate any functions. As an overview,
the following functions have been deprecated in earlier versions
and will be removed in the next major version (i.e., 4.0.0):
* Function iterator_wrapper are deprecated.
Please use the member function items() instead.
Functions friend std::istream& operator<<(basic_json&, std::istream&)
and friend std::ostream& operator>>(const basic_json&, std::ostream&)
are deprecated. Please use friend std::istream& operator>>(std::istream&, basic_json&)
and friend operator<<(std::ostream&, const basic_json&) instead.
OBS-URL: https://build.opensuse.org/request/show/793735
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/nlohmann_json?expand=0&rev=20
- Update to version 3.7.0
New Features
* Add overload of the contains function to check if a JSON
pointeris valid without throwing exceptions, just like its
counterpart for object keys.
* Add a function to_string to allow for generic conversion to
strings.
* Add return value for the emplace_back function, returning a
reference to the added element just like C++17 is introducing
this for std::vector.
Bug Fixes
* Fix an issue where typedefs with certain names yielded a
compilation error.
* Fix a conversion to std::string_view in the unit tests.
* Fix get_to method to clear existing content before writing.
Improvements
* Switch from Catch to doctest for the unit tests which speeds
up compilation and runtime of the 112,112,308 tests.
* Add an explicit section to the README about the frequently
addressed topics character encoding, comments in JSON, and the
order of object keys.
* Use GNUInstallDirs to set library install directories.
- Use previously introduced testsuite timeout only on Tumbleweed
or newer since the way the timeout parameter is passed to the
%ctest macro does not work on older distributions.
OBS-URL: https://build.opensuse.org/request/show/719726
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/nlohmann_json?expand=0&rev=18
- Lower required cmake version
- Update to version 3.6.1
New Features
* Overworked the public interface for JSON Pointers. The creation
of JSON Pointers is simplified with operator/ and operator/=.
JSON Pointers can be inspected with empty, back, and
parent_pointer, and manipulated with push_back and pop_back.
* Added a boolean method contains to check whether an element
exists in a JSON object with a given key. Returns false when
acalled on non-object types.
Improvements
* The performance of dumping integers has been greatly improved.
* Added CMake parameter JSON_Install to control whether the
library should be installed (default: on).
* Fixed a lot of compiler and linter warnings.
* Reduced required CMake version from 3.8 to 3.1.
* Added nodiscard attribute to meta(), array(), object(),
from_cbor, from_msgpack, from_ubjson, from_bson, and parse.
OBS-URL: https://build.opensuse.org/request/show/688044
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/nlohmann_json?expand=0&rev=14
- Update to version 3.5.0
This release introduces the support for structured bindings and
reading from FILE*. Besides, a few bugs have been fixed.
All changes are backward-compatible.
- Update to version 3.4.0
This release introduces three new features:
* BSON (Binary JSON) is next to CBOR, MessagePack, and UBJSON the
fourth binary (de)serialization format supported by the library.
* Adjustable error handlers for invalid Unicode allows to specify
the behavior when invalid byte sequences are serialized.
* Simplified enum/JSON mapping with a macro in case the default
mapping to integers is not desired.
Furthermore, some effort has been invested in improving the parse
error messages. Besides, a few bugs have been fixed.
All changes are backward-compatible.
- Update to version 3.3.0
This release adds support for GCC 4.8. Furthermore, it adds a
function get_to to write a JSON value to a passed reference.
Another topic of this release was the CMake support which has
been overworked and documented.
Besides, a lot of bugs have been fixed and slight improvements
have been made. All changes are backward-compatible.
- Update to version 3.2.0
This release introduces a SAX interface to the library. While
this may be a very special feature used by only few people, it
allowed to unify all functions that consumed input and created
some kind of JSON value. Internally, now all existing functions
like parse, accept, from_cbor, from_msgpack, and from_ubjson use
the SAX interface with different event processors. This allowed
to separate the input processing from the value generation.
OBS-URL: https://build.opensuse.org/request/show/667163
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/nlohmann_json?expand=0&rev=8
- Update to version 3.1.2
Bug Fixes
* Fixed a memory leak occurring in the parser callback (#1001).
* Different specializations of basic_json (e.g., using different template
arguments for strings or objects) can now be used in assignments (#972, #
977, #986).
* Fixed a logical error in an iterator range check (#992).
Improvements
* The parser and the serialization now support user-defined string types (#
1006, #1009).
Further Changes
* Clang Analyzer is now used as additional static analyzer; see make
clang_analyze.
* Overworked README by adding links to the documentation (#981).
Deprecated functions
This release does not deprecate any functions. As an overview, the following
functions have been deprecated in earlier versions and will be removed in the
next major version (i.e., 4.0.0):
* Function iterator_wrapper are deprecated. Please use the member function
items() instead.
* Functions friend std::istream& operator<<(basic_json&, std::istream&) and
friend std::ostream& operator>>(const basic_json&, std::ostream&) are
deprecated. Please use friend std::istream& operator>>(std::istream&,
basic_json&) and friend operator<<(std::ostream&, const basic_json&)
instead.
OBS-URL: https://build.opensuse.org/request/show/595159
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/nlohmann_json?expand=0&rev=6