Mercurial > hg > piper-cpp
comparison vamp-json/VampJson.h @ 174:59c89b0e9375
Fix regression from old schema changes, regarding assessing whether a JSON response was successful
author | Lucas Thompson <dev@lucas.im> |
---|---|
date | Tue, 31 Jan 2017 22:47:12 +0000 |
parents | 0876b5e67afe |
children | 7532233f8e49 |
comparison
equal
deleted
inserted
replaced
173:492970caa62b | 174:59c89b0e9375 |
---|---|
1107 } | 1107 } |
1108 } | 1108 } |
1109 | 1109 |
1110 static bool | 1110 static bool |
1111 successful(json11::Json j, std::string &err) { | 1111 successful(json11::Json j, std::string &err) { |
1112 if (!j["success"].is_bool()) { | 1112 if (!j["result"].is_object()) { |
1113 err = "bool expected for success"; | 1113 err = "result object expected for success"; |
1114 return false; | 1114 return false; |
1115 } | 1115 } |
1116 return j["success"].bool_value(); | 1116 return true; |
1117 } | 1117 } |
1118 | 1118 |
1119 static void | 1119 static void |
1120 markRPC(json11::Json::object &jo) { | 1120 markRPC(json11::Json::object &jo) { |
1121 jo["jsonrpc"] = "2.0"; | 1121 jo["jsonrpc"] = "2.0"; |