* @brief Wraps a property map in a JSON Schema `object` envelope with optional required keys. */
| 78 | * @brief Wraps a property map in a JSON Schema `object` envelope with optional required keys. |
| 79 | */ |
| 80 | static QJsonObject makeObjectSchema(const QJsonObject& properties, const QJsonArray& required = {}) |
| 81 | { |
| 82 | QJsonObject schema; |
| 83 | schema[QStringLiteral("type")] = QStringLiteral("object"); |
| 84 | schema[QStringLiteral("properties")] = properties; |
| 85 | if (!required.isEmpty()) |
| 86 | schema[QStringLiteral("required")] = required; |
| 87 | |
| 88 | return schema; |
| 89 | } |
| 90 | |
| 91 | /** |
| 92 | * @brief Converts a string list into a JSON array for use as a schema `enum`. |
no test coverage detected