Refactor JSON-API and cleanups

This commit is contained in:
LordGrey
2024-04-23 21:37:44 +02:00
parent 4d90309911
commit d29a747586
38 changed files with 3730 additions and 2913 deletions

View File

@@ -193,11 +193,17 @@ QJsonObject LedDeviceWrapper::getLedDeviceSchemas()
}
QJsonObject schema;
if(!JsonUtils::parse(schemaPath, data, schema, Logger::getInstance("LEDDEVICE")))
QPair<bool, QStringList> parsingResult = JsonUtils::parse(schemaPath, data, schema, Logger::getInstance("LEDDEVICE"));
if (!parsingResult.first)
{
throw std::runtime_error("ERROR: JSON schema wrong of file: " + item.toStdString());
QStringList errorList = parsingResult.second;
for (const auto& errorMessage : errorList) {
Debug(Logger::getInstance("LEDDEVICE"), "JSON parse error: %s ", QSTRING_CSTR(errorMessage));
}
throw std::runtime_error("ERROR: JSON schema is wrong for file: " + item.toStdString());
}
schemaJson = schema;
schemaJson["title"] = QString("edt_dev_spec_header_title");