New macro for named JSON convertor generation#4092
Closed
radistmorse wants to merge 7 commits intonlohmann:developfrom
Closed
New macro for named JSON convertor generation#4092radistmorse wants to merge 7 commits intonlohmann:developfrom
radistmorse wants to merge 7 commits intonlohmann:developfrom
Conversation
nlohmann
requested changes
Sep 24, 2023
Owner
nlohmann
left a comment
There was a problem hiding this comment.
Please update to the latest develop branch and resolve conflicts.
🔴 Amalgamation check failed! 🔴The source code has not been amalgamated. @radistmorse |
|
This feature is very good, when can it be merged? |
Owner
|
When the CI is not failing any more. |
Author
|
I'll open a new PR since this one is quite stale |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch adds 4 new
NLOHMANN_DEFINE_TYPE_<***>_WITH_NAMESmacros. They behave the same way as the ones that are there, but require explicit JSON names. Useful for the situation when the fields in the class are following the naming convention that you do not want to expose to JSON, e.g.or if the name in JSON cannot be used as the field name because it is reserved, e.g.
Also, this patch includes the unit tests for the new macros, and the update for the README to describe the new and existing macros better.
Pull request checklist
Read the Contribution Guidelines for detailed information.
include/nlohmanndirectory, runmake amalgamateto create the single-header filessingle_include/nlohmann/json.hppandsingle_include/nlohmann/json_fwd.hpp. The whole process is described here.