Skip to content

Fix missing exports from json.cppm - #5137

Merged
nlohmann merged 7 commits into
nlohmann:developfrom
mikomikotaishi:patch-1
May 8, 2026
Merged

nlohmann merged 7 commits into
nlohmann:developfrom
mikomikotaishi:patch-1

Conversation

@mikomikotaishi

@mikomikotaishi mikomikotaishi commented Apr 15, 2026 •

Copy link
Copy Markdown
Contributor

[Describe your pull request here. Please read the text below the line and make sure you follow the checklist.]

This pull request restores some missing symbols that were present in the <nlohmann/json.hpp> header, but weren't exported in json.cppm. These include specialisations in namespace std (such as hash<> and less<>), as well as nlohmann::literals::json_literals::*. This is necessary as without this those specialisations and symbols are inaccessible from the module.

  • The changes are described in detail, both the what and why.
  • If applicable, an existing issue is referenced.
  • The Code coverage remained at 100%. A test case for every new line of code.
  • If applicable, the documentation is updated.
  • The source code is amalgamated by running make amalgamate.

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>
@github-actions github-actions Bot added the M label Apr 15, 2026
Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>
Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>
Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>
Comment thread docs/mkdocs/docs/features/modules.md Outdated
Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>
Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>
Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>
@mikomikotaishi

Copy link
Copy Markdown
Contributor Author

@nlohmann Hi, checking in on this again, is it ready to merge?

@nlohmann nlohmann left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@nlohmann nlohmann added this to the Release 3.12.1 milestone May 8, 2026
@nlohmann
nlohmann merged commit a64fc21 into nlohmann:develop May 8, 2026
142 checks passed
@nlohmann

nlohmann commented May 8, 2026

Copy link
Copy Markdown
Owner

Thanks!

@nlohmann nlohmann mentioned this pull request May 11, 2026
5 tasks done
GhostVaibhav pushed a commit to GhostVaibhav/json that referenced this pull request May 19, 2026
* Fix missing exports from `json.cppm`

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>

* Update documentation to describe what symbols are exported

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>

* Add mention of `std` symbols

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>

* Add `json_literals` inline namespace to `using` statement

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>

* Remove internals (`nlohmann::detail::*`) from module

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>

* Omit internals (`nlohmann::detail::*`) from modules documentation

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>

* Restore `nlohmann::detail` symbols with mention of the MSVC bug

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>

---------

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>
Signed-off-by: Vaibhav Sharma <48472541+GhostVaibhav@users.noreply.github.com>
jwnimmer-tri pushed a commit to jwnimmer-tri/json that referenced this pull request Sep 21, 2026
* Fix missing exports from `json.cppm`

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>

* Update documentation to describe what symbols are exported

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>

* Add mention of `std` symbols

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>

* Add `json_literals` inline namespace to `using` statement

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>

* Remove internals (`nlohmann::detail::*`) from module

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>

* Omit internals (`nlohmann::detail::*`) from modules documentation

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>

* Restore `nlohmann::detail` symbols with mention of the MSVC bug

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>

---------

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants