mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
JSON RPC Writer (configSet) (#175)
* Remove "endOfJson" Value Deprecated value from Hypercon * Remove "endOfJson" Value Deprecated value from Hypercon * Add writeJson function to JsonFactory * ability to ignore required value in schema file * Remove "endOfJson" Value * Add handleConfigSetCommand function * Add handleConfigSetCommand function * Update JsonSchemas.qrc * Update schema.json * Update JsonSchemaChecker.cpp * Add configSet command to Hyperion-remote * Add setConfigFile function * Add setConfigFile function * Add schema-configset.json
This commit is contained in:
committed by
redPanther
parent
97181fa83c
commit
68fd395670
@@ -63,4 +63,12 @@ public:
|
||||
}
|
||||
return jsonTree;
|
||||
}
|
||||
|
||||
static void writeJson(const std::string& filename, Json::Value& jsonTree)
|
||||
{
|
||||
Json::StyledStreamWriter writer;
|
||||
|
||||
std::ofstream ofs(filename.c_str());
|
||||
writer.write(ofs, jsonTree);
|
||||
}
|
||||
};
|
||||
|
@@ -43,7 +43,7 @@ public:
|
||||
/// @param value The JSON value to check
|
||||
/// @return true when the arguments is valid according to the schema
|
||||
///
|
||||
bool validate(const Json::Value & value);
|
||||
bool validate(const Json::Value & value, bool ignoreRequired = false);
|
||||
|
||||
///
|
||||
/// @return A list of error messages
|
||||
@@ -179,6 +179,8 @@ private:
|
||||
private:
|
||||
/// The schema of the entire json-configuration
|
||||
Json::Value _schema;
|
||||
/// ignore the required value in json schema
|
||||
bool _ignoreRequired;
|
||||
|
||||
/// The current location into a json-configuration structure being checked
|
||||
std::list<std::string> _currentPath;
|
||||
|
Reference in New Issue
Block a user