-
-
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
.dump() not allowing compact form #2678
Comments
Im just going to alter my copy of the lib, but, was this disabled for some reason? |
if anyone is having this issue, a workaround is a compact function using regex. Here's mine if you're interested:
|
@qikdauie Do the tests pass on your platform? From the test code at json/test/src/unit-inspection.cpp Lines 228 to 235 in 176d8e2
dump does what you expect.
|
@t-b on a deadline at the moment. Ill test asap and get back to the thread. Thanks for the response. |
I cannot reproduce the issue. The code for serialization is unchanged for months and part of the unit tests. Please provide a small working example. Please also check if the test suite passes. |
When trying to use dump(-1) or dump(), it is producing the effects of dump(0)
Please describe the steps to reproduce the issue.
use dump(-1) or dump(), it will add newlines.
Can you provide a small but working code example?
json obj { {"a", "ayyy"}, {"b", "beee"} } std::cout << obj.dump(-1);
output:
{\n "a": "ayyy",\n "b": "beee"\n }\n
What is the expected behavior?
{"a": "ayyy","b": "beee"}
In json.hpp starting a line 2236, the conditions here do not allow for -1 mode.
if (indent >= 0) { s.dump(*this, true, ensure_ascii, static_cast<unsigned int>(indent)); } else { s.dump(*this, false, ensure_ascii, 0); }
Which version of the library did you use?
develop
branchIf you experience a compilation error: can you compile and run the unit tests?
The text was updated successfully, but these errors were encountered: