Commit Graph

633 Commits

Author SHA1 Message Date
Niels Lohmann f23b3c63a2 Add AST-based public API checker and fix documentation gaps it found (#3691)
Adds tools/api_checker/: extract_api.py derives the public API surface directly
from the libclang AST (independent of documentation status), check_docs.py flags
public entries missing @sa links (and @sa on non-public ones), diff_api.py does
an overload-aware breaking/feature diff between two refs, check_macros.py cross-
checks documented macros against #define sites, and snapshot_release.py backfills
immutable per-release surface snapshots into tools/api_checker/history/ (v3.1.0
through v3.12.0) so diff_api.py can compare releases without live extraction.
POLICY.md documents what counts as public API and what stability is guaranteed.

Running this tooling against the current tree found and fixed a real documentation
backlog: ~25 new API doc pages (ordered_map's methods, json_sax's ctor/dtor/
operator=, byte_container_with_subtype's comparison operators, several orphaned
type aliases), each with a compiled and output-verified example, plus missing
@sa comments and stale/incorrect Version History entries on several existing
pages (found by diffing consecutive release pairs and checking whether the
resulting change was actually reflected in the target page's history section).

Also adds docs/home/api_changes.md, a per-release, per-function reference of
public API changes (v3.1.0 through v3.12.0) generated from the history/
snapshots, complementing (not replacing) the existing release notes.

Along the way, found and fixed several extractor bugs by testing against real
release tags rather than trusting the algorithm in isolation -- most notably an
identity-key scheme based on libclang's USR that encoded the enclosing class
template's own arity, and a since-renamed ABI inline-namespace pattern
(json_v3_11_0 vs. today's json_abi_v3_11_2) that neither of two earlier regex
attempts stripped correctly. Both are documented in extract_api.py's docstrings
and tools/api_checker/history/README.md so the failure mode doesn't recur
silently.

.github/workflows/check_api_docs.yml runs extract_api.py + check_docs.py in CI,
advisory-only for now (documented backlog may not be at zero for entities this
PR didn't touch), plus a blocking drift check on the committed
tools/api_checker/api_surface.json.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2026-07-11 18:59:00 +02:00
Niels Lohmann 272411c5e6 Overwork project infrastructure (#5218)
* 📡 overwork project infrastructure

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

* 🚷 fix GCC16 issue

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

* 🚷 fix GCC16 issue

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

* 🚷 only build module for GCC

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

* 🚷 fix build

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

* 📡 fix documentation

Closes #5012: fix the error_handler_t::ignore wording

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

* 📡 fix documentation

Closes #4354: fix "Custom data source" example

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

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2026-06-30 18:09:06 +02:00
Caillin Nugent 58cfecf7f7 Serialize enum (#5151)
* Added NLOHNMANN_JSON_SERIALIZE_ENUM_STRICT
- duplicate of NLOHMANN_JSON_SERIALIZE_ENUM

Signed-off-by: Caillin Nugent <caillinn@student.unimelb.edu.au>

* Added failing tests for NLOHMANN_JSON_SERIALIZE_ENUM_STRICT

Signed-off-by: Caillin Nugent <caillinn@student.unimelb.edu.au>

* modified NLOHMANN_JSON_SERIALIZE_STRICT to throw

Signed-off-by: Caillin Nugent <caillinn@student.unimelb.edu.au>

* added documentation and changed readme to include NLOHMANN_JSON_SERIALIZE_ENUM_STRICT

Signed-off-by: Caillin Nugent <caillinn@student.unimelb.edu.au>

* ran amalgamate

Signed-off-by: Caillin Nugent <caillinn@student.unimelb.edu.au>

* docs(macros): add page for JSON_SERIALIZE_ENUM_STRICT
- added page to nav
- added links to new page where appropriate

Signed-off-by: Caillin Nugent <caillinn@student.unimelb.edu.au>

* refactor(macros): make JSON_SERIALIZE_ENUM_STRICT use JSON_THROW
- added templated wrapper function to fix scope error in calling JSON_THROW

Signed-off-by: Caillin Nugent <caillinn@student.unimelb.edu.au>

* refactor(macros): make NLOHMANN_SERIALIZE_ENUM_STRICT use error code 410
- added error code 410 to docs

Signed-off-by: Caillin Nugent <caillinn@student.unimelb.edu.au>

* tests(macros): add test for to_json with enum value not mentioned
	       in mapping for NLOHMANN_JSON_SERIALIZE_ENUM_STRICT

Signed-off-by: Caillin Nugent <caillinn@student.unimelb.edu.au>

* Apply suggestions from code review

Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>
Signed-off-by: Caillin Nugent <nugentcaillin@gmail.com>

* fix(macro): prevent compilation error with -Werror and -Wunused-parameter
            with NLOHMANN_JSON_SERIALIZE_ENUM_STRICT
- casted exception to void to avoid warning

Signed-off-by: Caillin Nugent <caillinn@student.unimelb.edu.au>

* fix(docs): add link to NLOHMANN_SERIALIZE_ENUM_STRICT docs to exception page

Signed-off-by: Caillin Nugent <caillinn@student.unimelb.edu.au>

* docs(macros): add example of exception throwing for NLOHMANN_JSON_SERIALIZE_ENUM_STRICT

Signed-off-by: Caillin Nugent <caillinn@student.unimelb.edu.au>

* refactor(macros): add more in-depth error message to NLOHMANN_JSON_SERIALIZE_ENUM_STRICT
- changed error message to follow style of nlohmann/json#4989
- made description of throw wrapper more general
- updated tests and example of exceptions

Signed-off-by: Caillin Nugent <caillinn@student.unimelb.edu.au>

---------

Signed-off-by: Caillin Nugent <caillinn@student.unimelb.edu.au>
Signed-off-by: Caillin Nugent <nugentcaillin@gmail.com>
Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>
2026-05-18 20:37:07 +02:00
George Sedov cba5dc0ed8 New macros for the named JSON convertor generation (#4563)
* Add new macros for named conversions

* Unit tests for the named conversion macros

* Update the docs to include the new macros

* Fix the documentation for the macros

the correct maximum number of member variables is 63

* Fix CI tests

* update the named macros

* move the example files

* update the explicit macros expansion

* update documentation

* fix documentation hiccups

* astyle changes

* add static analysis exceptions

* change md header to explicit html to fit the length

* Small corrections to docs

Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>
Signed-off-by: George Sedov <radist.morse@gmail.com>

---------

Signed-off-by: George Sedov <radist.morse@gmail.com>
Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>
2026-05-16 10:04:22 +02:00
Niels Lohmann bdbafc52c0 🪩 add sponsor (#5156)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2026-05-04 14:55:52 +02:00
koala_oishi 80af29a39a fix grammatical wording in README.md (#5096)
Signed-off-by: Basabdatta Gupta <basabdattagupta.bg@gmail.com>
Co-authored-by: Basabdatta Gupta <basabdattagupta.bg@gmail.com>
2026-03-04 13:03:09 +01:00
Niels Lohmann 17d1dd9964 🪩 add sponsor note (#5063)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2026-01-27 17:05:04 +01:00
Niels Lohmann 515d994acb 🦉 adjust year (#5044)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2026-01-01 20:00:39 +01:00
cheese1 d6e6b21f16 Update README.md (#5040) 2025-12-29 23:05:44 +01:00
Gianfranco Costamagna 0c9b68e110 Add a mention of git_required label to skil tests also in case of network issues (#4851) 2025-11-02 08:34:30 +01:00
Andy Choi cda9c1e3bd Use get instead of template get in REAMD.md and docs in non-template context (#4846)
Signed-off-by: Andy Choi <ccpong516@gmail.com>
2025-10-30 10:23:04 +01:00
Miko b7f741165b Add proper C++20 module support (#4799) 2025-06-29 22:02:31 +02:00
Niels Lohmann 68c25aec60 Update customers and add Cloudback (#4797)
* 📡 update customers

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

* 📡 add badge to Cloudback

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

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-05-27 20:55:45 +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 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
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
Niels Lohmann d41ca94fa8 Adjust CMake minimal version (#4709)
* 🪝 adjust CMake versions

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

* 🪝 install OpenSSL for CMake

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

* 🪝 install OpenSSL for CMake

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

* 🪝 install OpenSSL for CMake

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

* 🪝 install OpenSSL for CMake

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

* 🪝 install OpenSSL for CMake

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

* 🤮 clean up

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

* 📡 update documentation

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

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-04-01 14:42:08 +02:00
Niels Lohmann 0f9e6ae098 Fix broken links (#4605)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-01-18 23:20:45 +01:00
Niels Lohmann 26cfec34be Clean up and document project files (#4560) 2025-01-17 06:53:35 +01:00
Niels Lohmann 1809b3d800 Add note to Jetbrains support (#4592)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-01-09 20:15:11 +01:00
Niels Lohmann 6a2ae22a5a 📡 add OpenSSF Scorecard badge 2024-12-15 17:16:26 +01:00
Niels Lohmann 549c79ba7e Overwork documentation (#4516) 2024-12-09 23:02:30 +01:00
Niels Lohmann 1b9a9d1f21 Update licenses (#4521)
* 🦉 update licenses

* 🦉 update licenses
2024-11-29 17:38:42 +01:00
Niels Lohmann e41905fcb0 🪩 thanks @phrrngtn 2024-11-27 18:03:21 +01:00
Niels Lohmann 3d6c664de2 Allow comparing default initialized iterators (#4512) 2024-11-26 06:35:14 +01:00
Niels Lohmann 1c5923e5d6 Add comment for #4494 (#4496) 2024-11-17 07:36:05 +01:00
Niels Lohmann 1825117e63 Another desperate try to fix the CI (#4489)
* 🎓 fix warning

* 🧛 update actions

* 🎓 fix warning

* 🎓 fix warning

* 🎓 fix warning

* 🧛 update actions

* 🧛 update actions

* 🎓 fix warning

* 🎓 fix warning

* 🧛 update actions

* 🎓 fix warning

* 🧛 update actions

* 🧛 update actions

* 🧛 update actions

* 🎓 fix warning

* 🎓 fix warning

* 🎓 fix warning

* 🎓 fix warning

* 🧛 update actions

* 🧛 update actions

* 🎓 fix warning

* 🧛 update actions

* 🧛 update actions

* 🧛 update actions

* 🧛 update actions

* 🧛 update actions
2024-11-13 10:21:26 +01:00
Philip Müller 16b3d841d5 Fixed an error in the Custom data source example. (#4335) 2024-04-08 21:11:25 +02:00
Niels Lohmann 3780b41dd0 🤑 update sponsors 2023-12-06 20:51:04 +01:00
Niels Lohmann 9cca280a4d JSON for Modern C++ 3.11.3 (#4222) 2023-11-28 22:36:31 +01:00
Niels Lohmann f56c6e2e30 Update documentation for the next release (#4216) 2023-11-26 15:51:19 +01:00
Aleksei Sapitskii 58d6aa5831 Support Apple's Swift Package Manager (#4010)
Co-authored-by: Aleksei <sapial@f-secure.com>
2023-10-21 19:41:10 +02:00
Niels Lohmann 5d2754306d 🪩 add sponsor 2023-06-14 07:39:09 +02:00
No c71ecde505 Use template get instead of get in examples (#4039)
Co-authored-by: tusooa <tusooa@kazv.moe>
2023-06-11 10:06:24 +02:00
Nicolas Jakob 6af826d0bd Add Vcpkg port version badge (#3988) 2023-03-24 14:45:47 +01:00
haadfida b2306145e1 removed lgtm badge and added Cirrus CI badge (#3937) 2023-02-01 08:19:45 +01:00
Florian Segginger 8fa0d7bb7e Change 2022 to 2023 (#3932) 2023-01-31 19:24:27 +01:00
Raphael Grimm 233d233439 Fix CI issues (#3906)
Co-authored-by: barcode <barcode@example.com>
2023-01-31 19:23:37 +01:00
Niels Lohmann 4c6cde72e5 Try old MinGW script (#3892)
* ⚗️ try old MinGW script

* ⚗️ add Clang 13, 14, and 15 for Windows

* 📡 add Clang version to README
2022-12-21 09:30:43 +01:00
Niels Lohmann 7f72eedc2d Clang 15 (#3876) 2022-12-11 17:08:34 +01:00
Niels Lohmann 24ba54e687 Fix pipeline (#3862) 2022-12-04 14:03:54 +01:00
Vertexwahn 2d1f9b6a7d Add Bazel build support (#3709) 2022-09-18 08:15:12 +02:00
tocic 9dfa722669 Fix typos in .md files (#3748) 2022-09-17 10:34:30 +02:00
Niels Lohmann c920f3f4fb Update Codacy link (#3740) 2022-09-16 08:54:27 +02:00
Niels Lohmann f7973f46d6 Use official Clang/GCC containers (#3703) 2022-08-27 17:28:50 +02:00
Niels Lohmann 9d69186291 🔫 set version to 3.11.2 2022-08-12 15:04:06 +02:00
Niels Lohmann b6e2942d1c Complete contributor list (#3670)
* 🧍 complete contributor list

* Update README.md

Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
2022-08-04 22:48:30 +02:00
Niels Lohmann ac20714e2e 🧍 complete contributor list (#3662) 2022-08-03 18:36:46 +02:00
Florian Albrechtskirchinger 2ac7d023d4 Add Discord badge to README (#3651) 2022-08-03 09:17:02 +02:00