Skip to content

v3.0 upgrade nlohmann json to v3.12.0 #4974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: v3.0
Choose a base branch
from
Draft

Conversation

mirostauder
Copy link
Collaborator

No description provided.

@mirostauder mirostauder self-assigned this May 30, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Hello @mirostauder, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

As gemini-code-assist, I've reviewed this pull request. The primary goal is to upgrade the embedded nlohmann/json library from version 3.11.2 to 3.12.0. This involves updating version numbers, copyright information, and incorporating changes introduced in the new version, specifically related to diagnostic positions and a new template parameter for the basic_json class.

Highlights

  • Library Version Upgrade: Updates the nlohmann/json library version from 3.11.2 to 3.12.0.
  • Version and Copyright Updates: Changes version numbers and copyright year in comments and preprocessor directives within the header file.
  • Diagnostic Positions Feature: Introduces the JSON_DIAGNOSTIC_POSITIONS macro and integrates it into the ABI tag generation, allowing for potential compile-time configuration of diagnostic features.
  • basic_json Template Change: Adds a new CustomBaseClass template parameter with a default value of void to the basic_json class definition, potentially allowing for custom base classes.

Changelog

  • deps/json/json_fwd.hpp
    • Updated version number in header comments from 3.11.2 to 3.12.0 (Lines 3, 21).
    • Updated copyright year in header comments from 2022 to 2025 (Lines 6, 24).
    • Updated version check macro condition to expect version 3.12.0 (Line 33).
    • Updated NLOHMANN_JSON_VERSION_MINOR and NLOHMANN_JSON_VERSION_PATCH macros to 12 and 0 respectively (Lines 40-41).
    • Added definition for JSON_DIAGNOSTIC_POSITIONS macro, defaulting to 0 (Lines 47-49).
    • Added ABI tag definition NLOHMANN_JSON_ABI_TAG_DIAGNOSTIC_POSITIONS based on JSON_DIAGNOSTIC_POSITIONS (Lines 61-64).
    • Updated NLOHMANN_JSON_ABI_TAGS_CONCAT_EX and NLOHMANN_JSON_ABI_TAGS_CONCAT macros to accept three arguments (Lines 78-80).
    • Included NLOHMANN_JSON_ABI_TAG_DIAGNOSTIC_POSITIONS in the NLOHMANN_JSON_ABI_TAGS concatenation (Lines 85-86).
    • Added CustomBaseClass = void as a new template parameter to the basic_json class definition (Line 162).
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


Upgrade the library,
New features now can be used,
JSON data flows.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request upgrades the nlohmann/json library to version v3.12.0. The changes in deps/json/json_fwd.hpp correctly reflect the version bump and incorporate new features and ABI considerations from this version, such as diagnostic positions and the option for a custom base class. Overall, the update seems to be applied correctly within this file, with one point of attention regarding the copyright year.

Summary of Findings

  • Copyright Year Mismatch: The copyright year in deps/json/json_fwd.hpp (and also observed in the provided full deps/json/json.hpp) is 2013 - 2025. This does not match the official nlohmann/json v3.12.0 release, which uses 2013-2023. It's important to keep third-party library copyright information accurate.

Merge Readiness

This pull request correctly updates the nlohmann/json library to v3.12.0 in the json_fwd.hpp file. However, there's a discrepancy in the copyright year which should be addressed to ensure accuracy with the upstream library. Once this minor correction is made, the PR should be in good shape for merging from the perspective of these file changes. As an AI, I am not authorized to approve pull requests; please ensure other reviewers approve this code before merging.

// |_____|_____|_____|_|___| https://github.com/nlohmann/json
//
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann <https://nlohmann.me>

Choose a reason for hiding this comment

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

medium

The copyright year range has been updated to 2013 - 2025. However, the official nlohmann/json v3.12.0 release appears to use 2013-2023 in its copyright notices (see json.hpp#L6 and json_fwd.hpp#L6 from the official repository).

Could you please verify and update this to match the upstream library's copyright information for version 3.12.0 to ensure accuracy?

Suggested change
// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann <https://nlohmann.me>
// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>

@mirostauder mirostauder changed the title upgrade nlohmann json to v3.12.0 v3.0 upgrade nlohmann json to v3.12.0 May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant