cpprestsdk
cpprestsdk copied to clipboard
Printing a json-array without sorting the keys
Hello, I would like an json-array to be printed unsorted. This is the code to initialize the array
web::json::value array = web::json::value::array();
int i=0;
for (...)
{
array[i][L"YYY"]=...
array[i][L"XXX"]=...
array[i][L"ZZZ"]=...
...
array[i][L"AAA"]=...
++i;
}
std::wstringstream ss;
array.serialize(ss);
std::string s= convertWStringToString(ss.str());
The problem is that the json is printed like that: AAA=..,..,XXX=..., YYY=..., ZZZ=... The array is obviously sorted. I want that the array is printed without sorting the keys: YYY=..., XXX=..., ZZZ=..., AAA=...
Any hints?