-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Serialize empty tuple into '[]' instead of null #4594
Conversation
0d8c626
to
0c84dd6
Compare
Title has typo on empty |
🔴 Amalgamation check failed! 🔴The source code has not been amalgamated. @codenut |
ecc7154
to
1aa1039
Compare
The coverage job is now fixed in the |
0b995ce
to
29f1571
Compare
🔴 Amalgamation check failed! 🔴The source code has not been amalgamated. @codenut |
Signed-off-by: Michael Valladolid <mikevalladolid@gmail.com>
I had a look at #4530, and the issue stated
and
However, when I execute this code // deserialize null
nlohmann::json j_null;
CHECK_NOTHROW(j_null.get<std::tuple<>>()); on this branch, I still get the error
I am fine with serializing and empty tuple to |
The linked issue title and first two sentences: Title
1
2
So I would say it fixes the title first sentence (round trip from c++ to json to c++) by fixing the serializing. I think it's clear that the serializing to It doesn't fix the second sentence (deserialize to |
Thanks @gregmarr. I totally agree, but I wanted to make sure to what extent we address all aspects of the issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Thanks! |
This PR fixes #4530 by serializing an empty tuple into
[]
instead ofnull
.Pull request checklist
Read the Contribution Guidelines for detailed information.
include/nlohmann
directory, runmake amalgamate
to create the single-header filessingle_include/nlohmann/json.hpp
andsingle_include/nlohmann/json_fwd.hpp
. The whole process is described here.Please don't
#ifdef
s or other means.