-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Basic nlohmann-json integration. #11967
Conversation
6d9ca13
to
8b07ad3
Compare
{ | ||
removeNullMembersHelper(_json); | ||
// TODO: Support this. |
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.
This needs to be fixed.
libsolutil/JSON.cpp
Outdated
if (_format.format == JsonFormat::Pretty) | ||
boost::replace_all(result, " \n", "\n"); | ||
return result; | ||
// TODO: support the other features |
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.
This needs to be fixed.
c2528b5
to
a7fc74b
Compare
Let me know if there're any more issues. I've not explicitly tested with range-v3 but |
3f8f5ca
to
cd6bc55
Compare
I pushed a rebase and will now look & go through the comments here |
Rebased and upgraded to nlohmann-json 3.11.2 which has proper ranges-v3 support. |
return _input.dump( | ||
/* indent */ (_format.format == JsonFormat::Pretty) ? static_cast<int>(_format.indent) : -1, | ||
/* indent_char */ ' ', | ||
/* ensure_ascii */ true |
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.
should be false
here - we have some tests using unicode
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.
This means unicode stuff is escaped, which is the default behaviour of JSON expected by many implementations.
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.
I just noticed that some tests are not working because of that. But yeah, we could also rewrite the tests - but maybe we should not.
Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
It is the single_include/json.hpp file from https://github.com/nlohmann/json/releases/tag/v3.10.2
This reverts commit c23093e.
Closing this as "postponed" for now. We'll keep the branch around as a basis for when we may pick this up again. |
Fixes #6900.
A partial rebase of aarlt@1329c25.