mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
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:
committed by
redPanther
parent
e46d392ed1
commit
b9ad2977de
@@ -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);
|
||||
|
@@ -20,6 +20,9 @@
|
||||
},
|
||||
"create": {
|
||||
"type" : "boolean"
|
||||
},
|
||||
"overwrite": {
|
||||
"type" : "boolean"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
|
Reference in New Issue
Block a user