I have an issue with JsonCpp library in C++ and sorting of keys after the json is produced. I found that JsonCpp is ignoring alphabetical order if there is Lowercase and Uppercase difference. It always favors Uppercase first and then alphabetical order.
Lets say we have this code to produce
Json::Value aJsonResult(Json::objectValue);
aJsonResult["ShuttersOpen"] = "test";
aJsonResult["ShutterType"] = "test";
aJsonResult["ShutterWidth"] = "test";
Json::StreamWriterBuilder aBuilder;
aBuilder["indentation"] = "";
return Json::writeString(aBuilder, aJsonResult).c_str();
But this produces output below, notice how ShuttersOpen key is last, even though its not correct.
{
"ShutterType": "test",
"ShutterWidth": "test",
"ShuttersOpen": "test"
}
Any ideas how to fix this, I could not find any documentation on the official site
jqto pipe both expected and actual JSON through and then compare the result, so that you get similar formatting and ordering.