Skip to content

Releases: nlohmann/json

JSON for Modern C++ version 3.12.0

11 Apr 08:43
55f9368
Compare
Choose a tag to compare

Release date: 2025-04-11
SHA-256: aaf127c04cb31c406e5b04a63f1ae89369fccde6d8fa7cdda1ed4f32dfc5de63 (json.hpp), b8cb0ef2dd7f57f18933997c9934bb1fa962594f701cd5a8d3c2c80541559372 (include.zip), 42f6e95cad6ec532fd372391373363b62a14af6d771056dbfc86160e6dfff7aa (json.tar.xz)

Summary

This release fixes some bugs found in the 3.11.3 release and adds some new features.

All changes are backward-compatible.

πŸ’° Note you can support this project via GitHub sponsors or PayPal.

Key updates and enhancements

  • 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. When enabled, this information is also included in exceptions to help pinpoint errors. #4517 #4455 #4570 #4569 #4572 #4571 #4579 #4585 #4561
  • Enhanced conversion macros: The conversion macros for arbitrary types now include several upgrades:
  • Support for std::optional: The library now supports conversions from/to std::optional types when compiled with C++17. #1749 #4036
  • Flexible string compatibility: Functions patch, diff, and flatten now work with arbitrary string types. #4536 #4134 #4613 #4019
  • Binary format enhancements:
    • The BJData mapping now supports draft 3, including optimized binary array types. #4513 #4588
    • The BSON mapping has added support for unsigned 64-bit integers. #4590 #4535 #3894
    • The get_number function used in the binary format implementations has been optimized to read multiple bytes at once. #4391
  • Multidimensional array conversion: Multidimensional C-style arrays can now be directly converted to JSON. #4262 #4248
  • 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. #4271 #4631
  • CMake 4.0 support. By adjusting the CMake minimal version to 3.5, CMake 4.0 can be used without warning or error. #4709

Changes and fixes

Warnings

The quality assurance page gives an overview of the warning flags used during the tests.

Compiler warnings

  • Suppress weak-vtables warning for exceptions. #4500 #4087
  • Add 40+ GCC warning flags for GCC 14.2.0. #4524
  • Fix ignored attribute warning during build. #4670
  • Add explanation for suppressed CodeQL issues. #4362 #4361
  • Move compiler flags to separate CMake files (GCC, Clang). #4560

Clang-Tidy

  • Suppress warnings modernize-use-std-numbers,
    readability-redundant-member-init, and bugprone-unused-local-non-trivial-variable. #4276
  • Suppress warnings modernize-type-traits and modernize-avoid-c-arrays in NLOHMANN_JSON_SERIALIZE_ENUM. #4497 #3924
  • Suppress warning boost-use-ranges as we do not want to rely on Boost. #4489
  • Suppress warning modernize-use-designated-initializers as designated initializers are a C++20 feature. #4489
  • Suppress warning modernize-use-ranges as ranges are a C++20 feature. #4489
  • Suppress warning clang-analyzer-webkit.NoUncountedMemberChecker as we are using pointers internally. #4701
  • Fix warning modernize-use-integer-sign-comparison . #4558

Build

CMake

  • Adjust CMake minimal version to 3.5. #4709
  • Allow overriding the CMake target name via variable NLOHMANN_JSON_TARGET_NAME. #4483
  • Add CPack support. #4459
  • Adjust CMake to generate a pkg-config file that follows the pkg-config conventions. #4456

Package Managers

  • Remove alwayslink=True Bazel flag. #4396
  • Improve Bazel support by switching to Bzlmod. #4584
  • Add VisionOS support to Swift Package Manager Package.swift definition file. #4611
  • Remove wsjcpp package manager support. #4623

CI

Tests

  • Add test for libstdc++. #4495
  • Skip enum tests when JSON_DisableEnumSerialization=ON. #4504 #4384
  • Add a build step to build the documentation. #4549
  • Fix the coverage job. #4595
  • Add comment on reproducible builds. #4494 #4496

Infrastructure

  • Remove unsupported macos-11 image; the following Xcode versions are no longer tested in the CI: '11.7', '12.4', '12.5.1', '13.0'. #4489
  • Add macos-13 image to test Xcode versions '14.2', '14.3', '14.3.1', '15.0.1', '15.1', '15.2'. #4489
  • Add macos-14 image to test Xcode versions '15.3', '15.4'. #4489
  • Add macos-15 image to test Xcode versions '16.0', '16.1'. #4489
  • Test GCC versions '4.8', '4.9', '5', '6' on json-ci image as these versions are no longer work on the respective gcc images (checkout fails). #4489
  • Add tests for GCC versions '13', '14'. #4489
  • Add tests for Clang versions '16', '17', '18', '19'. #4489
  • Update README with a table of compilers/OS used in the CI. #4489
  • Apply security best practices by StepSecurity. #4539 #4546 #4058 #4547 #4550 #4551
  • Use Dependabot to automatically update GitHub actions and Python tools used in the CI. #4489 #4541 #4540 #4543 #4544 #4545 #4542 #4548 #4557 #4567 #4600 #4601 #4602 #4603 #4604 #4615 #4614 #4616 #4617 #4620 #4624 #4625 #4634 #4635 #4646 #4648 #4652 #4659 #4661 #4664 #4665 #4668 #4672 #4680 #4683 #4688 #4689 #4695 #4697 #4698 #4700 #4707 #4711 #4715 #4716 #4718 #4719 #4726
  • Use ubuntu-latest image to run Valgrind. #4575
  • Use Clang image to run iwyu. #4574
  • Adjust permissions in workflows. #4553
  • Use Python to install cppcheck. #4553
  • Move requirements.txt files for cppcheck, cpplint, and reuse to central location. #4553
  • Adjust cppcheck call. #4553
  • Add code exclusions to source files. #4553
  • Migrate stalebot to GitHub action. #4560
  • Remove deprecated .lgtm.yml file. #4560
  • Add CI steps for C++26. #4560
  • Add Xcode 16.2 (macOS) and Clang 3.4 (Ubuntu) action. #4560
  • Simplify Ubuntu workflow to use ubuntu-latest more often and reduce dependencies to more exotic containers. #4560
  • Add DCO requirement: all commits since January 17, 2025, need to be signed off. #4560
  • Remove .pre-commit-config.yml file. #4560
  • Pull update for tests/thirdparty/imapdl/filterbr.py. #4560
  • Make gdb-pretty-printer work with older Python versions. #4691 #4693
  • Update the REUSE integration. #4521

Indentation and amalgamation

  • Adjust and modernize flags for Artistic Style. #4277 #4275 #4573
  • Fix deprecation warning in amalgamation CI check. #4227

Documentation

The documentation website contains all project documentation.

Fixed documentation

Read more

JSON for Modern C++ version 3.11.3

28 Nov 21:38
9cca280
Compare
Choose a tag to compare

Release date: 2023-11-28
SHA-256: 9bea4c8066ef4a1c206b2be5a36302f8926f7fdc6087af5d20b417d0cf103ea6 (json.hpp), a22461d13119ac5c78f205d3df1db13403e58ce1bb1794edc9313677313f4a9d (include.zip), d6c65aca6b1ed68e7a182f4757257b107ae403032760ed6ef121c9d55e81757d (json.tar.xz)

Summary

This release fixes some bugs found in the 3.11.2 release.

All changes are backward-compatible.

πŸ’° Note you can support this project via GitHub sponsors or PayPal.

✨ New Features

  • Allow custom base class as node customization point. This adds an additional template parameter which allows to set a custom base class for nlohmann::json. This class serves as an extension point and allows to add functionality to json node. Examples for such functionality might be metadata or additional member functions (e.g., visitors) or other application specific code. By default the parameter is set to void and an empty base class is used. In this case the library behaves as it already did. #3110
  • Add more specific parse error message when attempting to parse empty input. #4037 #4180
  • Add serialization-only user defined type macros (NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_ONLY_SERIALIZE and NLOHMANN_DEFINE_TYPE_INTRUSIVE_ONLY_SERIALIZE). #3816
  • Add Bazel build support. If you are using Bazel you can simply reference this repository using http_archive or git_repository and depend on @nlohmann_json//:json. #3709
  • Support Apple's Swift Package Manager. #4010

πŸ› Bug Fixes

  • Adjust CMake files to accept NEW CMake policies up to CMake 3.14. This fixes a nasty deprecation warning that "Compatibility with CMake < 3.5 will be removed from a future version of CMake". #4076 #4112
  • Fix CMake header path in install with custom CMAKE_INSTALL_INCLUDEDIR. #4194
  • Add missing <numeric> header include. #3717 #3718 #3719
  • Replace uses of INT_MIN/INT_MAX, etc. with std::numeric_limits and consistently use std-namespaced integer types to make library work with newer GCC versions. #3722 #3723
  • Add missing files (json_fwd.hpp and Bazel build files) to release artifact include.zip. #3727 #3728
  • Fix 'declaration hides global declaration' warning. #3751
  • Fix natvis XML. #3858 #3863
  • Fix warning about moved from object. #3805 #3889
  • Remove a magic number to fix a warning. #3837 #3888
  • Fix debug pretty-printer by checking if match is valid before accessing group. #3919 #3920
  • Fix custom allocators by defining missing rebind type. #3895 #3927
  • Prevent memory leak when exception is thrown in adl_serializer::to_json #3881 #3901
  • Fix Clang-Tidy warnings. #4047
  • Fix init-list construction when size_type is not int. #4140
  • Fix deprecation warning "identifier _json preceded by whitespace in a literal operator declaration". #4129 #4161
  • Fix compile error with _HAS_STATIC_RTTI=0. #4046
  • Fix char_traits deprecation warning "char_traits<unsigned char> is deprecated: char_traits<T> for T not equal to char, wchar_t, char8_t, char16_t or char32_t is non-standard". #4163 #4179

πŸ”¨ Further Changes

CI

Documentation

Tests

  • Use std::ranges::equals for range comparisons in test case. #3927 #3950
  • Add more algorithm tests to unit-algorithm.cpp. #4044

πŸ”₯ Deprecated functions

This release does not deprecate any function. See the migration guide for help adjusting your code for future versions.

The following functions have been deprecated in earlier versions and will be removed in the next major version (i.e., 4.0.0):

All deprecations are annotated with HEDLEY_DEPRECATED_FOR to report which function to use instead.

JSON for Modern C++ version 3.11.2

12 Aug 13:06
bc889af
Compare
Choose a tag to compare

Release date: 2022-08-12
SHA-256: 665fa14b8af3837966949e8eb0052d583e2ac105d3438baba9951785512cf921 (json.hpp), e5c7a9f49a16814be27e4ed0ee900ecd0092bfb7dbfca65b5a421b774dccaaed (include.zip), 8c4b26bf4b422252e13f332bc5e388ec0ab5c3443d24399acb675e68278d341f (json.tar.xz)

Summary

This release fixes some bugs found in the 3.11.1 release. Furthermore, the of the namespace library has been re-structured.

All changes are backward-compatible.

πŸ’° Note you can support this project via GitHub sponsors or PayPal.

πŸ› Bug Fixes

  • Fix the value function which was broken for strings, size types, and nullptr in release 3.11.0. #3652 #3655 #3663
  • Fix the json_fwd.hpp header to be self-contained and add it to the single-header release. #3656 #3679 #3687
  • Fix regression that broke using json_pointer as key in associative containers. #3680 #3685
  • Add missing constraint to deprecated JSON Pointer overloads of contains and at. #3658 #3681
  • Fix comparison between json_pointer and strings with == and !=. These comparisons worked in 3.10.5, but were broken in 3.11.0 and 3.11.1. #3654 #3664
  • Fix to_json conversion of std::vector<bool>::reference and std::vector<bool>::const_reference for STLs where these are the same as basic_json::boolean_t& and basic_json::boolean_t, respectively. #3677 #3678

⚑ Improvements

πŸ”¨ Further Changes

Documentation

Community

  • Add a badge for the Discord chat to the README file. The goal of that additional communication channel beyond the existing ones is to quickly coordinate between the contributors. #3651
  • Complete contributor list. #3662 #3670

CI

  • Remove the macos-10.15 image from the CI as it is removed by GitHub Actions. #3612 #3615 #3626
  • Remove hardcoded paths in Ubuntu workflow. #3626
  • Only trigger AppVeyor builds if relevant files have been changed. #3626
  • Fix CodeQL warning. #3626
  • Harmonize naming of GitHub Actions jobs. #3661
  • Add labeler action to automatically add PR labels based on the changed files. #3671 #3674 #3675
  • Lint API documentation in the CI. #3672
  • Add local LGTM configuration and suppress warnings on third-party scripts. #3643

πŸ”₯ 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):

  • The function iterator_wrapper is 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.
  • 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 implicit conversion from JSON Pointers to string (json_pointer::operator string_t) is deprecated. Use json_pointer::to_string instead.

All deprecations are annotated with HEDLEY_DEPRECATED_FOR to report which function to use instead.

JSON for Modern C++ version 3.11.1

01 Aug 21:32
69d7448
Compare
Choose a tag to compare

Release date: 2022-08-01
SHA-256: 9279dc616aac67efce68967f118051b50236612b90572e059783d368bd78687e (json.hpp), 9c15ca7806f863872452bfbc85fee6d1c9868117e3ea5e00a204ae961a2e1ae7 (include.zip), e6dd39f8f2da9cab11de2212acdd40b1cc1aafbe09da8c92933b911d19da3302 (json.tar.xz)

Known issues

  • #3652 Regression: call to member function 'value' is ambiguous
  • #3654 Regression: no match for 'operator!=' comparing json_pointer and const char */string_t
  • #3655 Regression: .value<size_t> is compilation error

All issues are fixed in the develop branch and will be part of the 3.11.2 release.

Summary

Version 3.11.0 moved the user-defined string literals (UDL) into namespace nlohmann::literals::json_literals (see documentation). Unfortunately, this namespace was not imported to the global namespace by default which broke code. This release fixes this bug.

All changes are backward-compatible. See release notes of version 3.11.0 for more information on other features.

πŸ’° Note you can support this project via GitHub sponsors or PayPal.

πŸ› Bug fixes

  • Set default value of JSON_USE_GLOBAL_UDLS and the CMake options JSON_GlobalUDLs to 1 to import the user-defined string literals from the nlohmann::literals::json_literals namespace into the global namespace by default. #3644 #3645 #3646

JSON for Modern C++ version 3.11.0

01 Aug 11:16
499422b
Compare
Choose a tag to compare

πŸ› Unfortunately, this release introduced a bug that breaks existing usages of the user-defined string literals (UDL). This is fixed in version 3.11.1.


Release date: 2022-08-01
SHA-256: eb73896e9ce706ae6a62ce697dc8aca214840f70d8281779a6ea0cabe3afab3f (json.hpp), b4789050cacd110faf8b100cee82af19ad0b4d3249625f6582a60eeeb80c84a7 (include.zip), 5c8f7a4d9e9c0d565e71b6e5b0b3a12f784ffbf142e1ddc7ba86002cefb4c6ee (json.tar.xz)

Summary

Version 3.11.0 is one of the biggest releases (in terms of closed issues and merged pull requests) ever. It brings:

  • 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>.

All changes are backward-compatible.

πŸ’° Note you can support this project via GitHub sponsors or PayPal.

✨ New Features

πŸ› Bug fixes

⚑ Improvements

Warnings

  • Fix ICPC warning 1098. #3632, #3634
  • Fix a -Wpragmas warning in GCC <11. #3550

πŸ”¨ Further Changes

CI

  • Add support for Visual Studio 2022., #3295
  • Adjust GitHub Actions CI wrt. windows-latest image. #3368
  • Remove deprecated windows-2016 image. #3416
  • Speed up AppVeyor CI. #3422
  • Update CI image to check with ICPC, GCC 11 and Clang 14. #3420
  • Add build step for ICPC to CI. #3465
  • Add more Xcode versions (13.3.1, 13.3, 13.2.1, 13.2, and 13.1) to the CI. #3485
  • Fix "JSON_MultipleHeaders" option spelling in CI. #3555
  • Increase timeout for Unicode tests. #3579, #3580, #3614
  • Abort CI runs on newer commits on the same branch. #3610
  • Fix MinGW CI failures. #3618
  • Disable exceptions on ICPC (for the disabled_exceptions unit test). #3621

Unit tests

Documentation and examples

πŸ”₯ Deprecated functions

The implicit conversion from JSON Pointers to string (json_pointer::operator string_t) has been deprecated. Use json_pointer::to_string instead.

The following functions have been deprecated in earlier versions and will be removed in the next m...

Read more

JSON for Modern C++ version 3.10.5

03 Jan 05:41
4f8fba1
Compare
Choose a tag to compare

Release date: 2022-01-03
SHA-256: e832d339d9e0c042e7dff807754769d778cf5d6ae9730ce21eed56de99cb5e86 (json.hpp), b94997df68856753b72f0d7a3703b7d484d4745c567f3584ef97c96c25a5798e (include.zip)

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.

πŸ’° Note you can support this project via GitHub sponsors or PayPal.

πŸ› Bug fixes

Warnings

⚑ Improvements

  • Add a parameter to the update function to recursively merge objects with common keys. #3006 #3069
  • Extend std::hash and std::swap to work on any nlohmann::basic_json specializations rather than just nlohmann::json. #3121

πŸ”¨ Further Changes

Tests and CI

  • Update CI to use Clang 14, GCC 6, and Clang-Tidy 14. #3088
  • Update cpplint. #3225
  • Add build step for the Nvidia CUDA Compiler (NVCC). #3227
  • Remove Travis CI. #3087 #3233
  • Compile and execute the test suite with C++17. #3101

Documentation

πŸ”₯ 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):

All deprecations are annotated with HEDLEY_DEPRECATED_FOR to report which function to use instead.

JSON for Modern C++ version 3.10.4

16 Oct 12:49
fec56a1
Compare
Choose a tag to compare

Release date: 2021-10-16
SHA-256: c9ac7589260f36ea7016d4d51a6c95809803298c7caec9f55830a0214c5f9140 (json.hpp), 62c585468054e2d8e7c2759c0d990fd339d13be988577699366fe195162d16cb (include.zip)

Summary

This release fixes two bugs introduced in release 3.10.0 and fixes the conversion of std::filesystem::path. All changes are backward-compatible.

πŸ’° Note you can support this project via GitHub sponsors or PayPal.

πŸ› Bug Fixes

  • Fix regression bug introduced in release 3.10.0 which broke compilation for types with an explicit default constructor with default arguments. #3077 #3079
  • Fix regression bug introduced in release 3.10.0 which treated the return values of std::find and std::remove as pointers which could break compilation. #3081 #3082
  • Fix converting std::filesystem::path to JSON. Before release 3.10.3, such a conversion would trigger a stack overflow. Release 3.10.3 then further broke compilation on Windows. #3070 #3073

πŸ”₯ 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):

All deprecations are annotated with HEDLEY_DEPRECATED_FOR to report which function to use instead.

JSON for Modern C++ version 3.10.3

08 Oct 12:40
aa0e847
Compare
Choose a tag to compare

Release date: 2021-10-08
SHA-256: bac28658a4c9410faa55960a70c1ac541e8a51bbaae57dc395e23ca5abd3159a (json.hpp), 4ae5744bc1edd216c79f619fd49915c0e490e41b05434c2d2b89e078299f04ed (include.zip)

Summary

This release fixes two more bug introduced in release 3.10.0: the extended diagnostics triggered assertions when used with update() or when inserting elements into arrays. All changes are backward-compatible.

πŸ’° Note you can support this project via GitHub sponsors or PayPal.

πŸ› Bug Fixes

  • Fix bug in the update() function when used with extended diagnostics. #3007 #3008
  • Fix bug when inserting into arrays when using extended diagnostics. #2926 #3032 #3037

⚑ Improvements

Binary formats

  • Custom allocators are now supported when writing binary formats (e.g., CBOR, MessagePack) into a std::vector. #2982 #2989

User-defined type support

  • Allow conversion from types that do not define an explicit iterator type, but have a begin() and end() function. #3020

Tests and CI

Documentation

  • Add script to generate docset for Dash, Velocity, and Zeal. #2967

πŸ”₯ 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):

All deprecations are annotated with HEDLEY_DEPRECATED_FOR to report which function to use instead.

JSON for Modern C++ version 3.10.2

26 Aug 07:09
626e7d6
Compare
Choose a tag to compare

Release date: 2021-08-26
SHA-256: 059743e48b37e41579ee3a92e82e984bfa0d2a9a2b20b175d04db8089f46f047 (json.hpp), 61e605be15e88deeac4582aaf01c09d616f8302edde7adcaba9261ddc3b4ceca (include.zip)

Summary

This release is made days after the 3.10.1 release due to a bug in the release script: The 3.10.1 release at GitHub contained the correct files, but the associated tag v3.10.1 points to the wrong commit. This release is made with a fixed build script. All changes are backward-compatible.

πŸ’° Note you can support this project via GitHub sponsors or PayPal.

⚑ Improvements

  • Fix the release scripts to correctly tag releases. #2973
  • Fix some -Wunused warnings on JSON_DIAGNOSTICS when the library is built without CMake. #2975 #2976

πŸ”₯ 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):

All deprecations are annotated with HEDLEY_DEPRECATED_FOR to report which function to use instead.

JSON for Modern C++ version 3.10.1

24 Aug 19:09
7194245
Compare
Choose a tag to compare

Release date: 2021-08-24
SHA-256: 0b628af78a2f0f3e2ff41d8dfa18314dd53831ffc2720c2944192d9f53727f4d (json.hpp), 144268f7f85afb0f0fbea7c796723c849724c975f9108ffdadde9ecedaa5f0b1 (include.zip)

Summary

This release fixes a bug introduced in release 3.10.0: the extended diagnostics triggered an assertion when used with ordered_json. All changes are backward-compatible.

πŸ’° Note you can support this project via GitHub sponsors or PayPal.

πŸ› Bug Fixes

  • Fix an assertion triggered in the extended diagnostics using ordered_json. #2962 #2963
  • Make GDB pretty-printer robust against unset variable names. #2950

⚑ Improvements

Warnings

  • Add a missing header to hash.hpp. #2948
  • Fix some -Wextra-semi-stmt warnings. #2957

Tests and CI

  • Avoid duplicate builds in AppVeyor. #2952
  • Remove an outdated test binary that is not supported any longer. #2941 #2945
  • Skip tests that would fail if CMake option JSON_Install is set to OFF. #2946 #2947
  • Move Travis jobs to travis-ci.com. #2938 #2959
  • Set stack size for some unit tests when building with MSVC. #2955 #2961
  • Add a regression test. #2960

Documentation

πŸ”₯ 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):

All deprecations are annotated with HEDLEY_DEPRECATED_FOR to report which function to use instead.