* @brief Extracts a required non-empty string param or returns an error response. */
| 39 | * @brief Extracts a required non-empty string param or returns an error response. |
| 40 | */ |
| 41 | [[nodiscard]] static bool requireString(const QJsonObject& params, const QString& key, QString& out) |
| 42 | { |
| 43 | if (!params.contains(key)) |
| 44 | return false; |
| 45 | |
| 46 | out = params.value(key).toString(); |
| 47 | return !out.isEmpty(); |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * @brief Converts a QJsonValue to a QVariant preserving numeric vs string type. |
no test coverage detected