Skip to content
Tags give the ability to mark specific points in history as being important
  • v2.0.10
    1356af61 · Upstream release v2.0.10 ·
    - Release date: 2017-01-02
    - SHA-256: ec27d4e74e9ce0f78066389a70724afd07f10761009322dc020656704ad5296d
    
    This release fixes several security-relevant bugs in the MessagePack and CBOR parsers. The fixes are backwards compatible.
    
    - :bug: Fixed a lot of **bugs in the CBOR and MesssagePack parsers**. These bugs occurred if invalid input was parsed and then could lead in buffer overflows. These bugs were found with Google's [OSS-Fuzz](https://github.com/google/oss-fuzz), see #405, #407, #408, #409, #411, and #412 for more information.
    - :construction_worker: We now also use the **[Doozer](https://doozer.io) continuous integration platform**.
    - :construction_worker: The complete test suite is now also run with **Clang's address sanitizer and undefined-behavior sanitizer**.
    - :white_check_mark: Overworked **fuzz testing**; CBOR and MessagePack implementations are now fuzz-tested. Furthermore, all fuzz tests now include a round trip which ensures created output can again be properly parsed and yields the same JSON value.
    - :memo: Clarified documentation of `find()` function to always return `end()` when called on non-object value types.
    - :hammer: Moved thirdparty test code to `test/thirdparty` directory.
  • v2.0.8
    4fa69c9c · Upstream release v2.0.8 ·
    - Release date: 2016-12-02
    - SHA-256: b70db0ad34f8e0e61dc3f0cbab88099336c9674c193d8a3439d93d6aca2d7120
    
    This release combines a lot of small fixes and improvements. The fixes are backwards compatible.
    
    - :bug: fixed a bug that froze the parser if a passed file was not found (now, `std::invalid_argument` is thrown)
    - :bug: fixed a bug that lead to an error of a file at EOF was parsed again (now, `std::invalid_argument` is thrown)
    - :sparkles: the well known functions [`emplace`](http://nlohmann.github.io/json/classnlohmann_1_1basic__json_a602f275f0359ab181221384989810604.html#a602f275f0359ab181221384989810604) and [`emplace_back`](http://nlohmann.github.io/json/classnlohmann_1_1basic__json_af8a435033327d9237da414afc1cce513.html#af8a435033327d9237da414afc1cce513) have been added to JSON values and work as expected
    - :zap: improved the performance of the serialization (`dump` function)
    - :zap: improved the performance of the deserialization (parser)
    - :construction_worker: some continuous integration images at [Travis](https://travis-ci.org/nlohmann/json) were added and retired; see [here](https://github.com/nlohmann/json#supported-compilers) for the current continuous integration setup
    - :construction_worker: the [Coverity scan](https://scan.coverity.com/projects/nlohmann-json) works again
    - :chart_with_upwards_trend: the benchmarking code has been improved to produce more stable results
    - :memo: the [README](https://github.com/nlohmann/json/blob/develop/README.md) file has been extended and includes more frequently asked examples
    - :white_check_mark: the test suite now contains 8905518 tests
    - :arrow_up: updated [Catch](https://github.com/philsquared/Catch) to version 1.5.8
  • v2.0.9
    598710c3 · Upstream release v2.0.9 ·
    - Release date: 2016-12-16
    - SHA-256: fbf3396f13e187d6c214c297bddc742d918ea9b55e10bfb3d9f458b9bfdc22e5
    
    This release implements with **[CBOR](http://cbor.io)** and **[MessagePack](http://msgpack.org)** two **binary serialization/deserialization formats**. It further contains some small fixes and improvements. The fixes are backwards compatible.
    
    ![cbor](https://cloud.githubusercontent.com/assets/159488/22399181/d4d60d32-e597-11e6-8dcb-825abcf9ac2a.png)
    
    - :sparkles: The library can now read and write the binary formats **[CBOR](http://cbor.io)** (Concise Binary Object Representation) and **[MessagePack](http://msgpack.org)**. Both formats are aimed to produce a very compact representation of JSON which can be parsed very efficiently. See the  [README file](https://github.com/nlohmann/json#binary-formats-cbor-and-messagepack) for more information and examples.
    - :fire: simplified the iteration implementation allowing to remove dozens of lines of code
    - :bug: fixed an [integer overflow error](https://github.com/nlohmann/json/issues/389) detected by [Google's OSS-Fuzz](https://github.com/google/oss-fuzz)
    - :bug: suppressed documentation warnings inside the library to facilitate compilation with `-Wdocumentation`
    - :bug: fixed an overflow detection error in the number parser
    - :memo: updated [contribution guidelines](https://github.com/nlohmann/json/blob/develop/.github/CONTRIBUTING.md) to a list of frequentely asked features that will most likely be never added to the library
    - :memo:  added a **table of contents** to the [README file](https://github.com/nlohmann/json/blob/develop/README.md) to add some structure
    - :memo: mentioned the many [examples](https://github.com/nlohmann/json/tree/develop/doc/examples) and the [documentation](https://nlohmann.github.io/json/) in the [README file]()
    - :hammer: split [unit tests](https://github.com/nlohmann/json/tree/develop/test/src) into individual independent binaries to speed up compilation and testing
    - :white_check_mark: the test suite now contains **11201886** tests
  • v2.0.6
    c5264aa1 · Upstream release v2.0.6 ·
    - Release date: 2016-10-15
    - SHA256: 459cc93d5e2f503e50c6d5876eb86bfea7daf405f5a567c5a2c9abc2383756ae
    
    This release fixes the semantics of `operator[]` for JSON Pointers (see below). This fix is backwards compatible.
    
    - **`operator[]` for JSON Pointers** now behaves like the other versions of `operator[]` and transforms `null` values into objects or arrays if required. This allows to created nested structues like `j["/foo/bar/2"] = 17` (yielding `{"foo": "bar": [null, null, 17]}`) without problems.
    - overworked a helper SFINAE function
    - fixed some documentation issues
    - fixed the CMake files to allow to run the test suite outside the main project directory
    - restored test coverage to 100%.
  • v2.0.7
    ff779d0d · Upstream release v2.0.7 ·
    - Release date: 2016-11-02
    - SHA-256: 5545c323670f8165bae90b9dc6078825e86ec310d96cc4e5b47233ea43715bbf
    
    This release fixes a few bugs in the JSON parser found in the [Parsing JSON is a Minefield 💣](http://seriot.ch/parsing_json.html) article. The fixes are backwards compatible.
    
    - The article [Parsing JSON is a Minefield 💣](http://seriot.ch/parsing_json.html) discusses a lot of pitfalls of the JSON specification. When investigating the published test cases, a few bugs in the library were found and fixed:
      - Files with less than 5 bytes can now be parsed without error.
      - The library now properly rejects any file encoding other than UTF-8. Furthermore, incorrect surrogate pairs are properly detected and rejected.
      - The library now accepts all but one "yes" test (y_string_utf16.json): UTF-16 is not supported.
      - The library rejects all but one "no" test (n_number_then_00.json): Null bytes are treated as end of file instead of an error. This allows to parse input from null-terminated strings.
    - The string length passed to a user-defined string literal is now exploited to choose a more efficient constructor.
    - A few grammar mistakes in the README file have been fixed.
  • v2.0.4
    20676cc5 · Upstream release v2.0.4 ·
    - Release date: 2016-09-11
    - SHA-256: 632ceec4c25c4e2153f71470d3a2b992c8355f6d8b4d627d05dd16095cd3aeda
    
    This release fixes a bug in the stream parser (function `parse()` and the `<<`/`>>` operators). This fix is backwards compatible.
    
    - **Bug fix**: The end of a file stream was not detected properly which led to parse errors.
    - Fixed a compiler warning about an unused variable.
  • v2.0.5
    d66105ad · Upstream release v2.0.5 ·
    - Release date: 2016-09-14
    - SHA-256: 8b7565263a44e2b7d3b89808bc73d2d639037ff0c1f379e3d56dbd77e00b98d9
    
    This release fixes a regression bug in the stream parser (function `parse()` and the `<<`/`>>` operators). This fix is backwards compatible.
    
    - **Bug fix**: The end of a file stream was not detected properly which led to parse errors. This bug should have been fixed with 2.0.4, but there was still a flaw in the code.
  • v2.0.1
    83d5cb38 · Upstream release v2.0.1 ·
    - Release date: 2016-06-28
    - SHA-256: ef550fcd7df572555bf068e9ec4e9d3b9e4cdd441cecb0dcea9ea7fd313f72dd
    
    This release fixes a performance regression in the JSON serialization (function `dump()`). This fix is backwards compatible.
    
    - The locale of the output stream (or the internal string stream if a JSON value is serialized to a string) is now adjusted once for the whole serialization instead of for each floating-point number.
    - The locale of an output stream is now correctly reset to the previous value by the JSON library.
  • v2.0.2
    87a5a56e · Upstream release v2.0.2 ·
    - Release date: 2016-07-31
    - SHA-256: 8e97b7965b4594b00998d6704465412360e1a0ed927badb51ded8b82291a8f3d
    
    This release combines a lot of small fixes and improvements. The release is backwards compatible.
    
    - The **parser** has been overworked, and a lot of small issues have been fixed:
      - Improved parser performance by avoiding recursion and using move semantics for the return value.
      - Unescaped control charaters `\x10`-`\x1f` are not accepted any more.
      - Fixed a bug in the parser when reading from an input stream.
      - Improved test case coverage for UTF-8 parsing: now, all valid Unicode code points are tested both escaped and unescaped.
      - The precision of output streams is now preserved by the parser.
    - Started to check the **code correctness** by proving termination of important loops. Furthermore, individual assertions have been replaced by a more systematic function which checks the class invariants. Note that assertions should be switched off in production by defining the preprocessor macro `NDEBUG`, see the [documentation of `assert`](http://en.cppreference.com/w/cpp/error/assert).
    - A lot of **code cleanup**: removed unused headers, fixed some compiler warnings, and fixed a build error for Windows-based Clang builds.
    - Added some compile-time checks:
      - Unsupported compilers are rejected during compilation with an `#error` command.
      - Static assertion prohibits code with incompatible pointer types used in `get_ptr()`.
    - Improved the [documentation](https://nlohmann.github.io/json/), and adjusted the documentation script to choose the correct version of `sed`.
    - Replaced a lot of "raw loops" by STL functions like `std::all_of`, `std::for_each`, or `std::accumulate`. This facilitates reasoning about termination of loops and sometimes allowed to simplify functions to a single return statement.
    - Implemented a `value()` function for JSON pointers (similar to `at` function).
    - The Homebrew formula (see [Integration](https://github.com/nlohmann/json#integration)) is now tested for all Xcode builds (6.1 - 8.x) with Travis.
    - Avoided output to `std::cout` in the test cases.
  • v2.0.3
    d999f29d · Upstream release v2.0.3 ·
    - Release date: 2016-08-31
    - SHA-256: 535b73efe5546fde9e763c14aeadfc7b58183c0b3cd43c29741025aba6cf6bd3
    
    This release combines a lot of small fixes and improvements. The release is backwards compatible.
    
    - The **parser/deserialization functions have been generalized** to process any contiguous sequence of 1-byte elements (e.g., `char`, `unsigned char`, `uint8_t`). This includes all kind of string representations (string literals, char arrays, `std::string`, `const char*`), contiguous containers (C-style arrays, `std::vector`, `std::array`, `std::valarray`, `std::initializer_list`). User-defined containers providing random-access iterator access via `std::begin` and `std::end` can be used as well. See the documentation ([1](https://nlohmann.github.io/json/classnlohmann_1_1basic__json_ace63ac4eb1dd7251a259d32e397461a3.html#ace63ac4eb1dd7251a259d32e397461a3), [2](https://nlohmann.github.io/json/classnlohmann_1_1basic__json_a90f05d55d9d0702c075cd281fd0d85ae.html#a90f05d55d9d0702c075cd281fd0d85ae), [3](https://nlohmann.github.io/json/classnlohmann_1_1basic__json_aeffd70f622f8f2a51fd3d95af64b63a7.html#aeffd70f622f8f2a51fd3d95af64b63a7), [4](https://nlohmann.github.io/json/classnlohmann_1_1basic__json_aa8dca2e91a6301c36890f844e64f0023.html#aa8dca2e91a6301c36890f844e64f0023)) for more information. Note that contiguous storage cannot be checked at compile time; if any of the parse functions are called with a noncompliant container, the behavior is undefined and will most likely yield segmentation violation. The preconditions are enforced by an assertion unless the library is compiled with preprocessor symbol `NDEBUG`.
    - As a general remark on **assertions**: The library uses assertions to preclude undefined behavior. A [prominent example](https://github.com/nlohmann/json/issues/289) for this is the `operator[]` for const JSON objects. The behavior of this const version of the operator is undefined if the given key does not exist in the JSON object, because unlike the non-const version, it cannot add a `null` value at the given key. Assertions can be switched of by defining the preprocessor symbol `NDEBUG`. See the [documentation of `assert`](http://en.cppreference.com/w/cpp/error/assert) for more information.
    - In the course of cleaning up the parser/deserialization functions, the constructor [`basic_json(std::istream&, const parser_callback_t)`](https://nlohmann.github.io/json/classnlohmann_1_1basic__json_a32350263eb105764844c5a85e156a255.html#a32350263eb105764844c5a85e156a255) has been **deprecated** and will be deleted with the next major release 3.0.0 to unify the interface of the library. Deserialization will be done by stream operators or by calling one of the `parse` functions. That is, calls like `json j(i);` for an input stream `i` need to be replaced by `json j = json::parse(i);`. Compilers will produce a deprecation warning if client code uses this function.
    - Minor improvements:
      - Improved the performance of the serialization by avoiding the re-creation of a locale object.
      - Fixed two MSVC warnings. Compiling the test suite with `/Wall` now only warns about non-inlined functions (C4710) and the deprecation of the constructor from input-stream (C4996).
    - Some project internals:
      - <img align="right" src="https://bestpractices.coreinfrastructure.org/assets/questions_page_badge-17b338c0e8528d695d8676e23f39f17ca2b89bb88176370803ee69aeebcb5be4.png"> The project has qualified for the [Core Infrastructure Initiative Best Practices Badge](https://bestpractices.coreinfrastructure.org/projects/289). While most requirements where already satisfied, some led to a more explicit documentation of quality-ensuring procedures. For instance, static analysis is now executed with every commit on the build server. Furthermore, the [contribution guidelines document](https://github.com/nlohmann/json/blob/develop/.github/CONTRIBUTING.md) how to communicate security issues privately.
      - The test suite has been overworked and split into several files to allow for faster compilation and analysis. The execute the test suite, simply execute `make check`.
      - The continuous integration with [Travis](https://travis-ci.org/nlohmann/json) was extended with Clang versions 3.6.0 to 3.8.1 and now includes 18 different compiler/OS combinations.
      - An 11-day run of [American fuzzy lop](http://lcamtuf.coredump.cx/afl/) checked 962 million inputs on the parser and found no issue.
  • v1.1.0
    b23232e8 · Upstream release v1.1.0 ·
    - Release date: 2016-01-24
    - SHA-256: c0cf0e3017798ca6bb18e757ebc570d21a3bdac877845e2b9e9573d183ed2f05
    
    This release fixes several small bugs and adds functionality in a backwards-compatible manner. Compared to the [last version (1.0.0)](https://github.com/nlohmann/json/releases/tag/v1.0.0), the following changes have been made:
    
    - _Fixed_: **Floating-point numbers** are now serialized and deserialized properly such that rountripping works in more cases. [#185, #186, #190, #191, #194]
    - _Added_: The code now contains **assertions** to detect undefined behavior during development. As the standard function `assert` is used, the assertions can be switched off by defining the preprocessor symbol `NDEBUG` during compilation. [#168]
    - _Added_: It is now possible to get a **reference** to the stored values via the newly added function `get_ref()`. [#128, #184]
    - _Fixed_: Access to object values via keys (**`operator[]`**) now works with all kind of string representations. [#171, #189]
    - _Fixed_: The code now compiles again with **Microsoft Visual Studio 2015**. [#144, #167, #188]
    - _Fixed_: All required headers are now included.
    - _Fixed_: Typos and other small issues. [#162, #166,  #175, #177, #179, #180]
    
    There are still known open issues (#178, #187) which will be fixed in version 2.0.0. However, these fixes will require a small API change and will not be entirely backwards-compatible.
  • v2.0.0
    69d0b358 · Upstream release v2.0.0 ·
    - Release date: 2016-06-24
    - SHA-256: ac9e1fb25c2ac9ca5fc501fcd2fe3281fe04f07018a1b48820e7b1b11491bb6c
    
    This release adds several features such as JSON Pointers, JSON Patch, or support for 64 bit unsigned integers. Furthermore, several (subtle) bugs have been fixed.
    
    As `noexcept` and `constexpr` specifier have been added to several functions, the public API has effectively been changed in a (potential) non-backwards compatible manner. As we adhere to [Semantic Versioning](http://semver.org), this calls for a new major version, so say hello to 2️⃣.0️⃣.0️⃣.
    
    - 🔟 A JSON value now uses `uint64_t` (default value for template parameter `NumberUnsignedType`) as data type for **unsigned integer** values. This type is used automatically when an unsigned number is parsed. Furthermore, constructors, conversion operators and an `is_number_unsigned()` test have been added.
    -  👉 **JSON Pointer** ([RFC 6901](https://tools.ietf.org/html/rfc6901)) support: A JSON Pointer is a string (similar to an XPath expression) to address a value inside a structured JSON value. JSON Pointers can be used in `at()` and `operator[]` functions. Furthermore, JSON values can be “flattened” to key/value pairs using `flatten()` where each key is a JSON Pointer. The original value can be restored by “unflattening” the flattened value using `unflatten()`.
    - 🏥 **JSON Patch** ([RFC 6902](https://tools.ietf.org/html/rfc6902)) support. A JSON Patch is a JSON value that describes the required edit operations (add, change, remove, …) to transform a JSON value into another one. A JSON Patch can be created with function `diff(const basic_json&)` and applied with `patch(const basic_json&)`. Note the created patches use a rather primitive algorithm so far and leave room for improvement.
    - 🇪🇺 The code is now **locale-independent**: Floating-point numbers are always serialized with a period (`.`) as decimal separator and ignores different settings from the locale.
    - 🍺 **Homebrew** support: Install the library with `brew tap nlohmann/json && brew install nlohmann_json`.
    - Added constructor to create a JSON value by parsing a `std::istream` (e.g., `std::stringstream` or `std::ifstream`).
    - Added **`noexcept`** specifier to `basic_json(boolean_t)`, `basic_json(const number_integer_t)`, `basic_json(const int)`, `basic_json(const number_float_t)`, iterator functions (`begin()`, `end()`, etc.)
    - When parsing numbers, the sign of `0.0` (vs. `-0.0`) is preserved.
    - Improved MSVC 2015, Android, and MinGW support. See [README](https://github.com/nlohmann/json#supported-compilers) for more information.
    - Improved test coverage (added 2,225,386 tests).
    - Removed some misuses of `std::move`.
    - Fixed several compiler warnings.
    - Improved error messages from JSON parser.
    - Updated to [`re2c`](http://re2c.org) to version 0.16 to use a minimal DFAs for the lexer.
    - Updated test suite to use [Catch](https://github.com/philsquared/Catch) version 1.5.6.
    - Made type getters (`is_number`, etc.) and const value access `constexpr`.
    - Functions `push_back` and `operator+=` now work with key/value pairs passed as initializer list, e.g. `j_object += {"key", 1}`.
    - Overworked `CMakeLists.txt` to make it easier to integrate the library into other projects.
    
    - Parser error messages are still very vague and contain no information on the error location.
    - The implemented `diff` function is rather primitive and does not create minimal diffs.
    - The name of function `iteration_wrapper` may change in the future and the function will be deprecated in the next release.
    - Roundtripping (i.e., parsing a JSON value from a string, serializing it, and comparing the strings) of floating-point numbers is not 100% accurate. Note that [RFC 7159](https://tools.ietf.org/html/rfc7159) defines no format to internally represent numbers and states not requirement for roundtripping. Nevertheless, benchmarks like [Native JSON Benchmark](https://github.com/miloyip/nativejson-benchmark) treat roundtripping deviations as conformance errors.