Update dependency nlohmann_json to v3.12.0 #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
v3.10.5->v3.12.0Release Notes
nlohmann/json (nlohmann_json)
v3.12.0: JSON for Modern C++ version 3.12.0Compare Source
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
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 #4561json,ordered_json, and any otherbasic_jsonspecialization. #4597 #2528 #4377 #2532 #2843 #3810 #4608NLOHMANN_DEFINE_DERIVED_TYPE_*macros. #4033 #2199 #4562std::optional: The library now supports conversions from/tostd::optionaltypes when compiled with C++17. #1749 #4036patch,diff, andflattennow work with arbitrary string types. #4536 #4134 #4613 #4019get_numberfunction used in the binary format implementations has been optimized to read multiple bytes at once. #4391std::filesystem::pathare now encoded to UTF-8 strings by default on all operating systems. #4271 #4631Changes and fixes
iteration_proxyis now astd::forward_iteratorinstead of just anstd::input_iterator. This allows more use cases whenitems()is fed into C++20std::views. The iterator always satisfied all requirements for a forward iterator, but was exposed as only an input iterator by the used iterator tag. #4371 #4372m_dataadded. #4343 #4309basic_json. #4451 #4438 #4438nullptrtoparsefunction expectingFILE*. Instead, now an exception is thrown. #4485 #4487EINTRset inerrno. #4506number_floatto be locale-independent. #4505 #4084get_ptrfor unsigned integers. #4525 #4475EOFwithchar_traits. #4532NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULTthrow an exception with an empty json #4507 #4508[]instead ofnull. #4594 #4530Warnings
The quality assurance page gives an overview of the warning flags used during the tests.
Compiler warnings
weak-vtableswarning for exceptions. #4500 #4087Clang-Tidy
modernize-use-std-numbers,readability-redundant-member-init, andbugprone-unused-local-non-trivial-variable. #4276modernize-type-traitsandmodernize-avoid-c-arraysinNLOHMANN_JSON_SERIALIZE_ENUM. #4497 #3924boost-use-rangesas we do not want to rely on Boost. #4489modernize-use-designated-initializersas designated initializers are a C++20 feature. #4489modernize-use-rangesas ranges are a C++20 feature. #4489clang-analyzer-webkit.NoUncountedMemberCheckeras we are using pointers internally. #4701modernize-use-integer-sign-comparison. #4558Build
CMake
NLOHMANN_JSON_TARGET_NAME. #4483Package Managers
alwayslink=TrueBazel flag. #4396Package.swiftdefinition file. #4611CI
Tests
JSON_DisableEnumSerialization=ON. #4504 #4384Infrastructure
macos-11image; the following Xcode versions are no longer tested in the CI: '11.7', '12.4', '12.5.1', '13.0'. #4489macos-13image to test Xcode versions '14.2', '14.3', '14.3.1', '15.0.1', '15.1', '15.2'. #4489macos-14image to test Xcode versions '15.3', '15.4'. #4489macos-15image to test Xcode versions '16.0', '16.1'. #4489json-ciimage as these versions are no longer work on the respectivegccimages (checkout fails). #4489ubuntu-latestimage to run Valgrind. #4575requirements.txtfiles for cppcheck, cpplint, and reuse to central location. #4553.lgtm.ymlfile. #4560ubuntu-latestmore often and reduce dependencies to more exotic containers. #4560.pre-commit-config.ymlfile. #4560tests/thirdparty/imapdl/filterbr.py. #4560Indentation and amalgamation
Documentation
The documentation website contains all project documentation.
Fixed documentation
ci_test_api_documentationCI step. #4516Added documentation
FILES.md. #4560start_posandend_pos. #4560valuefunction. #4628 #4626JSON_DIAGNOSTIC_POSITIONSto macro feature page. #4636Improved documentation
parseandacceptwith respect to #4485 #4487 #4516Package Manager documentation
Documentation implementation
v3.11.3Compare Source
Full Changelog
Impossible de read json file create with nlohmann::ordered_json::dump #4556
Error C2039 : 'json_sax_dom_callback_parser': is not a member of 'nlohmann::json_abi_v3_11_3::detail' #4529
json_fwd.hppdon't define default template arguments for ordered_map #4518new repo version seems stop create any the ingress-nginx controller with opentelemetry-cpp.git #4515
Error converting to/from scoped enumerations #4499
Default initialized iterators are not comparable #4493
Bug json.exception.type_error.302 #4492
tests fail to build with clang-19 and libc++ due to unsupported
std::char_traits#4490Brace-Initialization Fails with json::parse and Key Access on Linux #4488
Crash when parsing nullptr #4485
Namespace macros are not respected in many instances #4484
ohos model to json string garbage characters #4481
Missing newlines in deserialized string #4479
Latest tag not available on NuGet #4478
Invalid union access for get_ref/get_ptr with unsigned integer #4475
/accesswallet #4469
struct reflect json with error C2440 #4467
Compiler error when using macro NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE #4463
Issue when dumping a vector of derived classes #4462
whit std::wstring compile error #4460
Inconsisten operator[] #4458
json parse enclosing json object with [] #4457
[bug] nlohmann::json constructor behaves improperly #4450
parse OOM #4449
Library Cannot Parse JSON File It Wrote #4448
Unexpected Integer Conversion of JSON Values on ARM64 #4447
Structure declared in natvis file template doesn't seem to match current structure of
basic_json<>#4438A lot of EOT in json file #4436
CVE-2024-34062 #4429
CVE-2024-39689 #4428
CVE-2024-5569 #4427
CVE-2024-37891 #4426
Tornado vulnerabilities #4425
CVE-2024-35195 #4424
CVE-2024-22195, CVE-2024-34064 #4423
CVE-2024-3651 #4422
CVE-2024-22190 #4421
CVE-2024-39705 #4420
Failing to read complex Unicode string embedded in JSON #4417
Unable to parse JSON string from snake case to camel case #4399
Crashes when I try to use ‘json::at()’ on a properly structured, non null, and correctly constructed ‘.json’ file #4387
JSON_BuildTests fail when JSON_DisableEnumSerialization is set to ON #4384
JSON can't parse a simple data #4383
json.exception.type_error.302 #4373
iteration_proxy has limited usefulness in C++20 range views #4371
Clone is long due to large history #4370
Can't use nlohmann on Linux #4363
CodeQL suppressions lack justification #4361
[json.exception.parse_error.101] parse error at line 1, column 4520: syntax error while parsing value - invalid string: forbidden character after backslash; last read: '".? #4352
Cannot unflatten json object #4349
Json parsed from raw string does not interpret lists of objects like json parsed from file #4341
natvis not updated to 3.11.3 #4340
Wrong function name in documentation example #4334
git ref got interpreted as number #4332
Is float valid number been limited? #4322
Crash when construct a new json object #4321
gdb-pretty-print broken since m_data added #4309
Docs have incorrect info for
update()#4307CBOR data cannot be decoded #4301
Inconsistent behaviour of json construction using
std::initializer_list#4299Assertion failed when accessing non-existing object with const json object #4297
Validatable release artifacts are not sufficient for packaging (trying to run tests) #4296
ordered json pointer corruption #4289
Incorrect floating point parsing #4285
Segfault on parse when using "#pragma pack (push, 1)" #4284
Simple example with nlohmann::ordered_json doesn't compile #4282
Program crashes with ordered_json, but works fine with json #4279
JSON parses as array when assigned in initializer list. #4278
Can't run
make amalgamate#4275Parsing the unicode string got the wrong result #4272
Issue with including <version> #4241
Exception when trying to insert my json object inside json file #4239
to_jsonis erroneously converting enums with underlying unsigned types to signed numbers #4236Build failure on macOS Sonoma 14.1.1 #4228
Deprecation warning on save action in check-amalgamation CI step #4227
3.11.3: test suite fails in 4 units #4224
Exception thrown when dumping utf-8 characters when using std::string #4213
patch_inplace assumes StringType is std::string #4134
Getting a weak-vtables warning with clang on ubuntu 22.04 #4087
SAX interface unexpectedly gets locale-altered float representation. #4084
Feat: hash pin github workflow dependencies #4058
compiler error using clang-16.0.5 when using gcc-13.1 standard library #4051
Missing requirement on
plantumlbinary package #4026Compile failure for macos 10.10 SDK + darwin14 #3991
Test suite does not compile with C++20 and Clang 17 #3979
modernize-avoid-c-arraysclang-tidy warning when usingNLOHMANN_JSON_SERIALIZE_ENUMmacro #3924JSON_DIAGNOSTICS trigger assertion #3915
Compiler warning 'array-bounds' on g++12.2.0 on Ubuntu 22.10 kinetic with RelWithDebugInfo #3808
The MSVC team recently test JSON project failed to run test on release configuration on windows_x64. #3542
Bad JSON diff when removing object in array of object #3146
Limit AppVeyor use #3089
pkgconfig integration wrongly rendered if tests are run #2907
Compile error for json in template and variadic macros. #2794
How to Serialize derived class to JSON object? #2199
[C++17] Allow std::optional to convert to nlohmann::json #1749
Fix typo in nlohmann_define_derived_type.md #4565 (gregmarr)
Add ONLY_SERIALIZE for NLOHMANN_DEFINE_DERIVED_TYPE_* macros #4562 (EinarsNG)
Suppress modernize-use-integer-sign-comparison #4558 (nlohmann)
Bump actions/upload-artifact from 4.4.3 to 4.5.0 #4557 (dependabot[bot])
Clean up CI #4553 (nlohmann)
[StepSecurity] ci: Harden GitHub Actions #4551 (step-security-bot)
Fix token permissions warnings #4550 (nlohmann)
Add step to build the documentation #4549 (nlohmann)
Bump mkdocs-material from 9.5.48 to 9.5.49 in /docs/mkdocs #4548 (dependabot[bot])
Move reuse dependency to requirements.txt file #4547 (nlohmann)
Clean up #4546 (nlohmann)
⬆️ Bump ossf/scorecard-action from 2.3.3 to 2.4.0 #4545 (dependabot[bot])
⬆️ Bump lukka/get-cmake from 3.31.0 to 3.31.2 #4544 (dependabot[bot])
⬆️ Bump github/codeql-action from 2.27.9 to 3.27.9 #4543 (dependabot[bot])
⬆️ Bump watchdog from 2.1.7 to 6.0.0 in /tools/serve_header #4542 (dependabot[bot])
⬆️ Bump pyyaml from 6.0 to 6.0.2 in /tools/serve_header #4541 (dependabot[bot])
⬆️ Bump actions/github-script from 6.4.0 to 7.0.1 #4540 (dependabot[bot])
[StepSecurity] Apply security best practices #4539 (step-security-bot)
Set parents after insert call #4537 (nlohmann)
Allow patch and diff to be used with arbitrary string types #4536 (nlohmann)
Add more package managers #4533 (nlohmann)
Replace EOF with char_traits #4532 (nlohmann)
Fix return value of get_ptr for unsigned integers #4525 (nlohmann)
Add more GCC warning flags #4524 (nlohmann)
Update licenses #4521 (nlohmann)
json start/end position implementation #4517 (sushshring)
Overwork documentation #4516 (nlohmann)
Allow comparing default initialized iterators #4512 (nlohmann)
fix: integer parsed as float when EINTR set in errno #4506 (StuartGorman)
Make SAX output locale-independent #4505 (nlohmann)
Skip enum tests when JSON_DisableEnumSerialization=ON #4504 (nlohmann)
Fix weak-vtables warning #4500 (nlohmann)
Suppress warnings in NLOHMANN_JSON_SERIALIZE_ENUM #4497 (nlohmann)
Add comment for #4494 #4496 (nlohmann)
Add test for libstdc++ #4495 (nlohmann)
Another desperate try to fix the CI #4489 (nlohmann)
Possible fix for #4485 #4487 (jordan-hoang)
Update CONTRIBUTING.md #4486 (zerocukor287)
Allow overriding the CMake target name #4483 (iboB)
Update is_structured.md #4472 (thetimr)
Add CPack support #4459 (zjyhjqs)
CMake: generate a pkg-config file that follow pkg-config conventions #4456 (dcbaker)
Update natvis to reflect 3.11.3 and the current structure of basic_json #4451 (gmyers18)
Docs: fix typos of 'whether' in
operator_{gt,le,lt}.md#4412 (tsnl)Remove alwayslink=True Bazel flag #4396 (mering)
Optimize binary
get_numberimplementation by reading multiple bytes at once #4391 (TianyiChen)Make iterator_proxy_value a forward_iterator (#4371) #4372 (captaincrutches)
Add lgtm explanation #4362 (nlohmann)
chore: fix some typos in comments #4345 (laterlaugh)
Fix gdb pretty printer #4343 (MrJia1997)
Fix for incorrect function name in documentation example #4342 (alexprabhat99)
Fixed an error in the
Custom data sourceexample. #4335 (philip-paul-mueller)Updated exception handling to catch const reference in out_of_range #4331 (LeilaShcheglova)
#4307 Updated docx to 3.10.5 from 3.10.4 #4310 (AniketDhemare)
Align astyle flags in Makefile with CI #4277 (serge-s)
Suppress Clang-Tidy warnings #4276 (nlohmann)
Remove broken link from CONTRIBUTING.md #4274 (serge-s)
Fix version in json_has_static_rtti.md #4269 (ALF-ONE)
Add support of multi-dim C-style array member of struct. #4262 (peng-wang-cn)
Docs: Fix wrong code usage in the Value access section of
json_pointer.md#4255 (Fallen-Breath)Fix
to_jsonfor enums when the enum has an unsigned underlying type. #4237 (TheJCAB)feat: Rebase
feature/optionaltodevelop#4036 (fsandhei)Add NLOHMANN_DEFINE_DERIVED_TYPE_* macros #4033 (rotolof)
v3.11.2Compare Source
Full Changelog
Parser and constructor resolve integer types differently #4207
README.md overuses
templatekeyword beforegetfunction #4205Exception SIGSEGV - Segmentation violation signal on file parsing (v3.11.2, linux, doctest) #4193
In highly nested functions, passing json into a function leads to a segmentation fault/bus error #4186
why a single-object json file appears in an array #4183
Initializing
jsonby direct initialization and copy initialization invokes different constructors #4174Deprecation warning about std::char_traits<unsigned char> #4163
LLVM 16.0.6 issues warning for literal operators when Wdeprecated-literal-operator #4129
GCC compiler warning about violating the C++ One Definition Rule [-Wodr] #4116
error: building nlohmann-json:arm64-osx failed with: BUILD_FAILED #4091
dump(): Non-conforming with JSON-spec escape of strings? #4088
Compiling in visual studio 2022 gives a warning #4081
Upgrade CMake minimum version #4076
\ character in the content of a string cause error in parser.? #4067
JSON Parsing Freeze Issue on Nintendo Switch #4066
Clang++ compilation fails on extremely small example #4061
how about open a new repository for header only version? #4060
json::count returns only 0 or 1 #4052
std::function error #4050
Json package not compiling properly #4042
Explicit conversion example in docs should use
template get#4038Improve wording of parse_error exception #4037
Parse error on valid JSON file #4028
Empty JSON object returns size of 1 #4027
Help needed to fix CI #4025
Security vulnerabilities detected: CVE-2022-24439, WS-2022-0438, WS-2022-0437 #4020
multithreading use from_msgpack leading very slow #4016
Error with sol for Lua: items() is not a recognized container #4012
Parser does not read non ascii characters : ŞÜİĞ #4007
malloc(): unaligned fastbin chunk detected #3999
try/catch block doesn't work while accessing const json& array. #3998
a bug about list #3995
heap corruption when i use nlohmann::json::accept function to check a valid json #3994
Exception on gcc but not apple clang #3986
Can't support convert the type? std::string json_str = R"({"value": "3.1415"})"; float value = j["value"].get<float>(); #3984
#pragma oncenot supported with C++20 modules in clang #3974const array_t::operator[] results in buffer overflow / segv on nullp
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.