Refactor Hyperion JSON-API (#1727)

This commit is contained in:
LordGrey
2024-05-08 22:06:32 +02:00
committed by GitHub
parent 94850d890a
commit cf287f5adb
64 changed files with 4203 additions and 2962 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");