1
0
mirror of https://github.com/nlohmann/json.git synced 2025-10-26 12:31:16 +03:00
Commit Graph

825 Commits

Author SHA1 Message Date
Niels Lohmann
54be9b04f0 📄 update REUSE (#4960) 2025-10-23 06:56:36 +02:00
Niels Lohmann
1cc56b2dcd Address CWG issue 2521 (#4957) 2025-10-23 06:56:16 +02:00
Niels Lohmann
a63795caf1 🚨 avoid deprecation warning (#4791)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-10-22 21:27:35 +02:00
Niels Lohmann
4106af8d92 🚨 suppress cppcoreguidelines-c-copy-assignment-signature,misc-unconventional-assign-operator (#4896)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-08-20 18:39:45 +02:00
Nikhil
efcf9efb4f Fixes #4854 Explicitly handle nullptr in sax_parse (#4873)
* handle nullptr explicitly

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* add test

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* make amalgamate

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* Fix formatting

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* move sax parse test to relevant unit test file

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* extend exceptions.md to include other_error.502

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* Better exception messages

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* link sax_parse function

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* fix string

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* amalgamate

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* fix clang-tidy checks

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* cover valid handler with no throw

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* Add tests for other two overloads

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* cover overload with valid sax handler

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* pass an rvalue

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* ignore -Wtautological-pointer-compare

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* ignore clang-analyzer-core.NonNullParamChecker

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* ignore gcc -Wnonnull-compare

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* ignore undefined-behaviour-sanitizer

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* nest directives to ignore sanitizer errors

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* use elif

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

---------

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>
2025-08-02 21:06:01 +02:00
Niels Lohmann
30d27df61c Fix CI (#4871)
* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-07-31 20:10:57 +02:00
David Kilzer
d70e46bc65 🐛 add missing header to input_adapters.hpp (#4830)
Signed-off-by: David Kilzer <ddkilzer@apple.com>
Co-authored-by: David Kilzer <ddkilzer@apple.com>
2025-06-25 07:20:17 +02:00
Niels Lohmann
cf16c5ab9f Use binary_t::value_type (#4805) 2025-06-02 06:35:27 +02:00
Niels Lohmann
b19f058465 Encode infinity and NaN as float for MsgPack and CBOR (#4802)
* 🚸 encode infinity and NaN as float for MsgPack and CBOR

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-06-01 18:50:14 +02:00
chirsz
4b17f90f65 Add ignore_trailing_commas option (#4609)
Added examples and modified the corresponding documents and unit tests.

Signed-off-by: chirsz-ever <chirsz-ever@outlook.com>
Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>
2025-05-22 08:01:46 +02:00
Niels Lohmann
828c891427 Extend type_name() to invalid type (#4786)
*  add regression test

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 💚 fix build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 📝 add comment

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-05-16 18:16:47 +02:00
NmPassTHFan
46e7cd3dc2 Replace deprecated std::is_trivial in C++26 (#4775) 2025-05-16 16:11:44 +02:00
Niels Lohmann
9110918cf8 Fix typos (#4748)
* ✏️ fix typos

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ✏️ address review comments

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ✏️ address review comments

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-05-04 10:28:24 +02:00
Ville Vesilehto
dff2b4756c fix: BJData size calculation overflow (#4765)
Adds pre-multiplication overflow detection to catch cases where dimension
products would exceed size_t max. The previous check only detected when
overflow resulted in exactly 0 or SIZE_MAX, missing other cases.

Retains the original post-multiplication check for backward compatibility.
Adds tests verifying overflow detection with dimensions (2^32+1)×(2^32),
which previously overflowed silently to 2^32.

This prevents custom SAX handlers from receiving incorrect array sizes
that could lead to buffer overflows.

Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
2025-04-29 10:17:50 +02:00
Niels Lohmann
eef76c200e Make library work with C++20 modules (#4764)
*  add test for C++20 modules

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* Add missing header (#4763)

* 🐛 add missing header

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-04-28 21:52:26 +02:00
Xiaochuan Ye
3b02afb9d9 Specialize char_traits for std::byte to fix from_msgpack (fixes #4756) (#4760)
* Specialize char_traits for std::byte to fix from_msgpack (fixes #4756)

Provide a char_traits<std::byte> specialization under __cpp_lib_byte
to allow parsing MessagePack data from containers of std::byte.

Signed-off-by: xuesongtap <tap91624@gmail.com>
Signed-off-by: yexiaochuan <tap91624@gmail.com>

* Fix comments for cstddef include and MessagePack tests

Signed-off-by: xuesongtap <tap91624@gmail.com>
Signed-off-by: yexiaochuan <tap91624@gmail.com>

* Fix include <cstddef> only when __cpp_lib_byte is defined and sufficient

Signed-off-by: yexiaochuan <tap91624@gmail.com>

* Fix clang-tidy warnings in MessagePack std::byte tests

Signed-off-by: yexiaochuan <tap91624@gmail.com>

* Fix handle return value in MessagePack tests

Signed-off-by: yexiaochuan <tap91624@gmail.com>

---------

Signed-off-by: xuesongtap <tap91624@gmail.com>
Signed-off-by: yexiaochuan <tap91624@gmail.com>
2025-04-28 16:19:47 +02:00
Niels Lohmann
6b9199382b Add missing header (#4763)
* 🐛 add missing header

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-04-27 18:18:57 +02:00
Sergiu Deitsch
756ca22ec5 Provide fallback for missing char8_t support (#4736) 2025-04-23 18:36:41 +02:00
Niels Lohmann
c67d538274 Fix C4702 warning and extend MSVC CI job (#4749)
* ⚗️ try matrix for latest

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ♻️ refactor from https://github.com/nlohmann/json/issues/4745#issuecomment-2810128420

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 simplify CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 simplify CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix cpplint warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 simplify CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-04-17 18:04:09 +02:00
Niels Lohmann
88c92e605c Fix compilation failure and warnings with NVHPC (#4744)
* 🚨 fix warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ enable ranges support

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🔥 remove ci_nvhpc job

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ enable ranges support

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🔥 remove ci_nvhpc job

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-04-16 16:09:21 +02:00
Niels Lohmann
96c1b52f1c Fix conversion to std::optional (#4742)
* ⚗️ remove JSON_USE_IMPLICIT_CONVERSIONS check for from_json(json, std::optional)

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ remove JSON_USE_IMPLICIT_CONVERSIONS check for from_json(json, std::optional)

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ remove JSON_USE_IMPLICIT_CONVERSIONS check for from_json(json, std::optional)

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ remove JSON_USE_IMPLICIT_CONVERSIONS check for from_json(json, std::optional)

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ remove JSON_USE_IMPLICIT_CONVERSIONS check for from_json(json, std::optional)

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ add C++ standard library as matrix option

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

*  remove inline

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-04-15 16:10:39 +02:00
Niels Lohmann
4cca3b9cb2 Fix warning and add emscripten CI step (#4738)
* 🚨 fix warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 add emscripten

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 add emscripten

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 add emscripten

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 add emscripten

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 add emscripten

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 add emscripten

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 add emscripten

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 add emscripten

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 add emscripten

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 📝 add compiler to list

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-04-13 17:54:56 +02:00
Niels Lohmann
1705bfe914 🔖 set version to 3.12.0 (#4727)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-04-11 10:41:14 +02:00
Niels Lohmann
4424a0fcc1 📝 update documentation (#4723)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-04-05 18:54:35 +02:00
risa2000
11aa5f944d Make std::filesystem::path conversion to/from UTF-8 encoded string explicit (#4631)
* Make std::filesystem::path conversion to/from UTF-8 encoded JSON string explicit.

Signed-off-by: Richard Musil <risa2000x@gmail.com>

* Experimental: Changing C++ standard detection logic to accommodate potential corner cases.

Signed-off-by: Richard Musil <risa2000x@gmail.com>

* Drop C++ standard tests for compilers which do not implement required features.

Signed-off-by: Richard Musil <risa2000x@gmail.com>

* Drop C++ standard tests for MSVC versions which do not implement required features.

Signed-off-by: Richard Musil <risa2000x@gmail.com>

---------

Signed-off-by: Richard Musil <risa2000x@gmail.com>
Co-authored-by: Richard Musil <risa2000x@gmail.com>
2025-04-04 10:59:23 +02:00
Niels Lohmann
b477d2b95e Suppress clang-analyzer-webkit.NoUncountedMemberChecker (#4701)
* 🚨 suppress clang-analyzer-webkit.NoUncountedMemberChecker

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 📝 add Clang 20/21

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-03-29 09:38:45 +01:00
Harinath Nampally
bf8ccc20e9 fix compilation issue (#4613)
* fix compilation issue

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* add unit test

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* fix ci failure check

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

---------

Signed-off-by: Harinath Nampally <harinath922@gmail.com>
2025-01-22 21:28:51 +01:00
Niels Lohmann
f06604fce0 Bump the copyright years (#4606)
* 📄 bump the copyright years

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 📄 bump the copyright years

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 📄 bump the copyright years

Signed-off-by: Niels Lohmann <niels.lohmann@gmail.com>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
Signed-off-by: Niels Lohmann <niels.lohmann@gmail.com>
2025-01-19 17:04:17 +01:00
Harinath Nampally
d23291ba26 use diagnostic positions in exceptions (#4585)
* add a ci step for Json_Diagnostic_Positions

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* Update ci.cmake to address review comments

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* address review comment

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* fix typo in the comment

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* fix typos in ci.cmake

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* invoke the new ci step from ubuntu.yml

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* issue4561 - use diagnostic positions for exceptions

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* fix ci_test_documentation check

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* address review comments

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* fix ci check failures for unit-diagnostic-postions.cpp

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* improvements based on review comments

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* fix const correctness string

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* further refinements based on reviews

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* add one more test case for full coverage

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* ci check fix - add const

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* add unit tests for json_diagnostic_postions only

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* fix ci_test_diagnostics

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* fix ci_test_build_documentation check

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

---------

Signed-off-by: Harinath Nampally <harinath922@gmail.com>
2025-01-19 10:42:21 +01:00
kimci86
8a882f32ed Generate template functions with NLOHMANN_DEFINE_TYPE macros (#4597)
* Support any basic_json type in NLOHMANN_DEFINE_TYPE_* macros

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Test NLOHMANN_DEFINE_TYPE_* macros also support unordered_json

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Simplify test about NLOHMANN_DEFINE_TYPE_ with many arguments

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Remove extra scope in macros tests

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Remove unused test class in macros tests

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Update documentation about NLOHMANN_DEFINE_TYPE_* macros

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Fix NLOHMANN_JSON_SERIALIZE_ENUM documentation

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Mark some variables const in macros tests, fixes clang-tidy

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Workaround clang 3.5 issue with const object initialization

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Update highlighted lines in NLOHMANN_DEFINE_TYPE_* macros examples

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Fix swapped macros in documentation

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Remove extra backslashes at the end of macros

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Require basic_json type in NLOHMANN_DEFINE_TYPE_* generated functions

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Fix typos in macros documentation

Signed-off-by: kimci86 <kimci86@hotmail.fr>

---------

Signed-off-by: kimci86 <kimci86@hotmail.fr>
2025-01-18 22:59:09 +01:00
Michael Valladolid
bdb8d2b7b3 Serialize empty tuple into '[]' instead of null (#4594)
Signed-off-by: Michael Valladolid <mikevalladolid@gmail.com>
2025-01-18 20:34:11 +01:00
Niels Lohmann
26cfec34be Clean up and document project files (#4560) 2025-01-17 06:53:35 +01:00
Michael Valladolid
2d42229f4d Support BSON uint64 de/serialization (#4590)
* Support BSON uint64 de/serialization

Signed-off-by: Michael Valladolid <mikevalladolid@gmail.com>

* Treat 0x11 as uint64 and not timestamp specific

Signed-off-by: Michael Valladolid <mikevalladolid@gmail.com>

---------

Signed-off-by: Michael Valladolid <mikevalladolid@gmail.com>
2025-01-10 14:59:55 +01:00
Nebojša Cvetković
48e7b4c23b BJData Fixes (#4588) 2025-01-07 22:10:38 +01:00
Nebojša Cvetković
2e50d5b2f3 BJData optimized binary array type (#4513) 2025-01-07 18:09:19 +01:00
Nikhil
60c48755e3 Add missing macros in README and link to docs for more info (#4582)
* Add nav items for serialize macros

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* match order of non-intrusive macros to intrusive macros

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* Add missing macros and link for more info

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* Add @brief macro tags

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* make amalgamate

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* Add since version tags

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* Revert "Add missing macros and link for more info"

This reverts commit 4c9b3ae9bf7a25c81dc1c6217a72a30a39086979.

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

---------

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>
2025-01-03 22:19:37 +01:00
Michael Valladolid
4f64d8d0b4 Modernize integer comparison (#4577)
Replace static_cast<size_t>(-1) with std::numeric_limits<std::size_t>::max()
via the detail::unknown_size() function
2025-01-01 17:01:38 +01:00
Nissim Armand Ben Danan
2134cb947a Fix NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT with an empty JSON instance (#4508)
* change NLOHMANN_JSON_FROM_WITH_DEFAULT to let NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT work with an empty JSON instance

* fix ci_static_analysis_clang (ci_clang_tidy)

* change NLOHMANN_JSON_FROM_WITH_DEFAULT to let NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT work with an empty JSON instance
2024-12-31 08:16:43 +01:00
Niels Lohmann
6057b31df7 Overwork astyle call (#4573)
* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* Use ubuntu-latest image to run Valgrind (#4575)

* 🔧 use Clang image to run valgrind

* 🔧 use Clang image to run valgrind

* 🔧 use Clang image to run valgrind

* 🔧 use Ubuntu image to run valgrind

* Use Clang image to run iwyu (#4574)

* 🔧 use Clang image to run iwyu

* 🔧 use Clang image to run iwyu

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🎨 format code

* 🔨 clean up
2024-12-29 17:06:03 +01:00
Niels Lohmann
0fa326a8e8 Use Clang image to run iwyu (#4574)
* 🔧 use Clang image to run iwyu

* 🔧 use Clang image to run iwyu
2024-12-29 15:49:35 +01:00
Harinath Nampally
5ff90d9e02 fix diagnostic positions related compilation errors (#4570) 2024-12-28 16:22:45 +01:00
Einars Netlis-Galejs
af4ad7915c Add ONLY_SERIALIZE for NLOHMANN_DEFINE_DERIVED_TYPE_* macros (#4562) 2024-12-20 11:31:22 +01:00
Sushrut Shringarputale
58f5f25968 json start/end position implementation (#4517)
* Add implementation to retrieve start and end positions of json during parse

* Add more unit tests and add start/stop parsing for arrays

* Add raw value for all types

* Add more tests and fix compiler warning

* Amalgamate

* Fix CLang GCC warnings

* Fix error in build

* Style using astyle 3.1

* Fix whitespace changes

* revert

* more whitespace reverts

* Address PR comments

* Fix failing issues

* More whitespace reverts

* Address remaining PR comments

* Address comments

* Switch to using custom base class instead of default basic_json

* Adding a basic using for a json using the new base class. Also address PR comments and fix CI failures

* Address decltype comments

* Diagnostic positions macro (#4)

Co-authored-by: Sush Shringarputale <sushring@linux.microsoft.com>

* Fix missed include deletion

* Add docs and address other PR comments (#5)

* Add docs and address other PR comments

---------

Co-authored-by: Sush Shringarputale <sushring@linux.microsoft.com>

* Address new PR comments and fix CI tests for documentation

* Update documentation based on feedback (#6)

---------

Co-authored-by: Sush Shringarputale <sushring@linux.microsoft.com>

* Address std::size_t and other comments

* Fix new CI issues

* Fix lcov

* Improve lcov case with update to handle_diagnostic_positions call for discarded values

* Fix indentation of LCOV_EXCL_STOP comments

* fix amalgamation astyle issue

---------

Co-authored-by: Sush Shringarputale <sushring@linux.microsoft.com>
2024-12-18 22:46:14 +01:00
Niels Lohmann
094bd2651b Set parents after insert call (#4537)
* 🐛 set parents after insert call

* 🚨 fix warning
2024-12-18 09:44:09 +01:00
Niels Lohmann
30cd44df95 Clean up CI (#4553)
* 💚 overwork cppcheck

* 🔒 adjust permissions

* 💚 fixes

* 💚 fixes
2024-12-17 18:58:05 +01:00
Niels Lohmann
620034ecec ♻️ allow patch and diff to be used with arbitrary string types (#4536) 2024-12-13 07:24:50 +01:00
Niels Lohmann
20ae363a71 Replace EOF with char_traits (#4532)
* 📝 update customers

* ♻️ replace EOF with char_traits #2755
2024-12-10 20:51:47 +01:00
peng-wang-cn
589641b175 Add support of multi-dim C-style array member of struct. (#4262)
* Add support of multi-dim C-style array.

* Support up to 4 dimensional array.

* Suppress clang-tidy checks for C-style arrays
2024-12-10 13:18:21 +01:00
Niels Lohmann
9f60e85557 Fix return value of get_ptr for unsigned integers (#4525)
* 🐛 fix return value of get_ptr for unsigned integers

* 📝 update documentation
2024-12-06 18:38:25 +01:00
Niels Lohmann
1b9a9d1f21 Update licenses (#4521)
* 📄 update licenses

* 📄 update licenses
2024-11-29 17:38:42 +01:00