• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nlohmann / json / 35009576755
98%

Build:
DEFAULT BRANCH: develop
Ran 15 Sep 2026 11:20PM UTC
Jobs 1
Files 33
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

15 Sep 2026 06:46PM UTC coverage: 97.817% (-0.01%) from 97.827%
35009576755

push

github

web-flow
Support custom object/array types and improve template parameter handling (#5443)

* docs: document the implicit requirements on basic_json's template parameters

The requirements that basic_json places on its eleven template parameters
were only implied by how the library uses the resulting object_t, array_t,
string_t, etc. Consumers had to discover them by trial and error.

Add "Template Parameter Requirements" collecting them, split into what is
always required and what is only required when a particular part of the API
is instantiated. Notable findings that were previously undocumented:

- ObjectType must provide a key_compare member type (actual_object_comparator
  names object_t::key_compare in both arms of a std::conditional), and its
  third template parameter is used as a comparator, so std::unordered_map
  cannot be used without a wrapper.
- ArrayType must provide capacity() -- push_back(), emplace_back(),
  operator+=(), and operator[](size_type) call it unconditionally -- and
  needs random-access iterators, so std::deque and std::list do not work.
- StringType needs contiguous, null-terminated data(), a one-byte value_type,
  and either assignability from std::to_string or an ADL int_to_string().
- NumberFloatType must be float, double, or long double for parsing and
  serialization; the integer types must satisfy std::is_integral.
- AllocatorType must be stateless, support incomplete types, and use plain
  pointers.
- BooleanType and the number types are union members and must be trivial.

Link the new page from the basic_json overview, the types feature page, and
the individual type alias pages, and correct the container examples given for
ObjectType (std::unordered_map) and ArrayType (std::list), which do not work.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018hxZxz8svM54c6ATEvXp5E
Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* Fix object_comparator_t for object types witho... (continued)

2606 of 2832 branches covered (92.02%)

107 of 111 new or added lines in 9 files covered. (96.4%)

26 existing lines in 1 file now uncovered.

7394 of 7559 relevant lines covered (97.82%)

15506559.71 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
94.74
-5.26% include/nlohmann/detail/string_escape.hpp
2
97.19
-0.1% include/nlohmann/json.hpp

Coverage Regressions

Lines Coverage ∆ File
26
97.19
-0.1% include/nlohmann/json.hpp
Jobs
ID Job ID Ran Files Coverage
1 35009576755.1 15 Sep 2026 11:20PM UTC 33
97.82
GitHub Action Run
Source Files on build 35009576755
  • Tree
  • List 33
  • Changed 10
  • Source Changed 10
  • Coverage Changed 10
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #35009576755
  • c72f37a4 on github
  • Prev Build on develop (#34886216293)
  • Next Build on develop (#35776605214)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc