json v3.9.1 Release Notes
Release Date: 2020-08-06 // 7 months ago-
๐ Release date: 2020-08-06
SHA-256: 7804b38146921d03374549c9e2a5e3acda097814c43caf2b96a0278e58df26e0 (json.hpp), 6bea5877b1541d353bd77bdfbdb2696333ae5ed8f9e8cc22df657192218cad91 (include.zip)Summary
This release fixes two bugs in the features introduced in release 3.9.0. The lexer did not accept consecutive comments , and
ordered_json
lacked some functions fromjson
. All changes are backward-compatible.๐ ๐ฐ Note you can support this project via GitHub sponsors or PayPal.
๐ฑ ๐ Bug Fixes
- The lexer did not accept input with two or more consecutive comments (e.g.
/* one */ /* two */ []
). #2330 #2332 - The newly introduced
ordered_json
container did not implement the complete interface ofbasic_json
which broke existing code whenjson
was replaced byordered_json
, in particular when trying to callordered_json::parse
. #2315 #2319 #2331
๐ฑ ๐จ Further Changes
- Install pkg-config file to
CMAKE_CURRENT_BINARY_DIR
instead ofCMAKE_BINARY_DIR
#2318 - Make installation directory of pkg-config file depend on
CMAKE_INSTALL_LIBDIR
. #2314 - ๐ Fix
-Wimplicit-fallthrough
warning. #2333 - ๐ Fix name of Homebrew formula in documentation. #2326 #2327
- ๐ Fix typo in documentation. #2320
๐ฑ ๐ฅ Deprecated functions
๐ 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 functionitems()
instead. - Functions
friend std::istream& operator<<(basic_json&, std::istream&)
andfriend std::ostream& operator>>(const basic_json&, std::ostream&)
are deprecated. Please usefriend std::istream& operator>>(std::istream&, basic_json&)
andfriend operator<<(std::ostream&, const basic_json&)
instead. - ๐ 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 the elements individually without braces.
๐ All deprecations are annotated with
HEDLEY_DEPRECATED_FOR
to report which function to use instead. - The lexer did not accept input with two or more consecutive comments (e.g.
Previous changes from v3.9.0
-
- Unknown Type Name clang error when using NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE #2313
- โ Clang 10.0 / GCC 10.1 warnings on disabled exceptions #2304
- Application stalls indefinitely with message byte size 10 #2293
- ๐ linker error #2292
- โ Add support for high-precision numbers in UBJSON encoding #2286
- NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE fails if the length of the argument is 10 #2280
- Custom types : MACRO expansion bug #2267
- to/from_json Failing To Convert String #2238
- โ clang 9.0 report warning: unused type alias 'size_type' [-Wunused-local-typedef] #2221
- Enormous array created when working with map<int,T> #2220
- Can I disable sorting of json values #2219
- Getting Qt types to work #2217
- Convert to Qt QVariant #2216
- How to custom serialize same data type of vector? #2215
- ๐ json constructor does not support std::optional #2214
- ๐ Failing to Parse Valid JSON #2209
- (De-)Serialization of std::variant with namespaces #2208
- โ Addint support for complex type #2207
- array_index possible out of range #2205
- Object deserialized as array #2204
- Sending to a function a reference to a sub-branch #2200
- How to Serialize derived class to JSON object? #2199
- JSON incorrectly serialized #2198
- Exception Unhandled out_of_range error #2197
- msgpack serialisation : float is treated as 64bit float, not 32bit float. #2196
- Is it possible to use compile-time type guarantees for JSON structures? #2195
- ๐ Question : performance against python dict #2194
- vs2017 compile error #2192
- Check if a key exists #2191
- ๐ Failed to run tests due to missing test data on builders without Internet access #2190
- โ 3.8.0: unit-cbor.cpp test failures #2189
- 'nlohmann/json.hpp' file not found #2188
- How to send json data over the wire? #2185
- ๐ Ubuntu 16 not supporting nlohmann/json? #2184
- .get<std::string> causing emdash errors #2180
- Object properties should not be re-sorted alphabetically #2179
- Custom type registration : instrusive API #2175
- Many version of the function "void to_json(json& j, const MyStruct& struct)" #2171
- How should strings be escaped? #2155
- โ Adding a value to an existing json puts it at the beginning instead of the end #2149
- The header file is big, can we use what we need. #2134
- 0๏ธโฃ Changing the default format for unordered_map (or other set) #2132
- Getting size of deserialized bson document #2131
- implicit conversion failure #2128
- ๐ Error thrown when parsing in a subclass #2124
- explicit conversion to string not considered for std::map keys in GCC8 #2096
- โ Add support for JSONC #2061
- Library provides template arg for string_type but assumes std::string in some places #2059
- ๐ incremental parsing with sax_parser #2030
- Question about flatten and unflatten #1989
- ๐ CBOR parser doesn't skip tags #1968
- ๐ Compilation failure using Clang on Windows #1898
- ๐ Fail to build when including json.hpp as a system include #1818
- ๐ Parsing string into json doesn't preserve the order correctly. #1817
- [C++17] Allow std::optional to convert to nlohmann::json #1749
- How can I save json object in file in order? #1717
- ๐ Support for Comments #1513
- clang compiler: error : unknown type name 'not' #1119
- dump() without alphabetical order #1106
- operator T() considered harmful #958
- Order of the elements in JSON object #952
- How to prevent alphabetical sorting of data? #727
- Why is an object ordering values by Alphabetical Order? #660
- ๐ Feature request: Comments #597
- Head Elements Sorting #543
- Automatic ordered JSON #424
- ๐ Support for comments. #376
- ๐ Optional comment support. #363
- Strip comments / Minify #294
maintaining order of keys during iteration #106
added inline to NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE macro #2306 (jwittbrodt)
โ Add test with multiple translation units #2301 (nlohmann)
โ Add support for high-precision numbers in UBJSON encoding #2297 (nlohmann)
Serialisation macros: increase upper bound on number of member variables #2287 (pfeatherstone)
โ add inline specifier for detail::combine #2285 (T0b1-iOS)
โ Add static assertion for missing binary function in SAX interface #2282 (nlohmann)
๐ Clean up maintainer Makefiles and fix some linter warnings #2274 (nlohmann)
๐ Make library work with Clang on Windows #2259 (nlohmann)
โ Add ordered_json specialization with ordered object keys #2258 (nlohmann)
๐ท Tag binary values in cbor if set #2244 (matthewbauer)
๐ง Make assert configurable via JSON_ASSERT #2242 (nlohmann)
๐ Refine documentation of error_handler parameter #2232 (nlohmann)
Enable CMake policy CMP0077 #2222 (alexreinking)
โ Add option to ignore comments in parse/accept functions #2212 (nlohmann)
๐ Simple ordered_json that works on all supported compilers #2206 (gatopeich)
๐ Use unsigned indizies for array index in json pointer #2203 (t-b)
โ Add option to not rely on Internet connectivity during test stage #2202 (nlohmann)
Serialize floating-point numbers with 32 bit when possible (MessagePack) #2201 (nlohmann)
Fix consistency in function
int\_to\_string\(\)
#2193 (dota17)๐ C++20 support by removing swap specialization #2176 (gracicot)
Feat/explicit conversion operator #1559 (theodelrieu)