Update and fix JSON writer (#183)

* Fixing the check of createKey in handleConfigSetCommand

* Update schema-config.json

* add overwrite option to configset command

* add overwrite option to setConfig function

* add overwrite option to setConfig function
This commit is contained in:
Paulchen-Panther
2016-08-18 21:11:21 +02:00
committed by redPanther
parent e46d392ed1
commit b9ad2977de
5 changed files with 11 additions and 5 deletions

View File

@@ -931,8 +931,9 @@ void JsonClientConnection::handleConfigSetCommand(const Json::Value &message, co
return;
}
bool createKey = message.isMember("create");
Json::Value hyperionConfig = _hyperion->getJsonConfig();
bool createKey = message["create"].asBool();
Json::Value hyperionConfig;
message["overwrite"].asBool() ? createKey = true : hyperionConfig = _hyperion->getJsonConfig();
nested::configSetCommand(message["config"], hyperionConfig, createKey);
JsonFactory::writeJson(_hyperion->getConfigFileName(), hyperionConfig);

View File

@@ -20,6 +20,9 @@
},
"create": {
"type" : "boolean"
},
"overwrite": {
"type" : "boolean"
}
},
"additionalProperties": false