How to change output order?
Json statusJSON = Json.emptyObject;
Json answerJSON = Json.emptyObject;
tatusJSON["status"] = "fail"; // user exists in DB, password NO
answerJSON["password"] = "wrongPassword"; // user exists in DB, password NO
answerJSON["isAuthorized"] = false;
statusJSON["error"] = answerJSON;
logInfo("-------------------------------------------------------------------------------");
logInfo(statusJSON.toString);
readln;
logInfo("^-----------------------------------------------------------------------------^");
logWarn("WRONG password for USER: %s", request["username"]); //getting username from request
{"error":{"isAuthorized":false,"password":"wrongPassword"},"status":"fail"}
I would like to do:"status":"fail", {"error":{"isAuthorized":false,"password":"wrongPassword"}}