MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / makeSchema

Function makeSchema

app/src/API/Handlers/NotificationsHandler.cpp:42–52  ·  view source on GitHub ↗

* @brief Builds a schema object from a properties map and required-keys list. */

Source from the content-addressed store, hash-verified

40 * @brief Builds a schema object from a properties map and required-keys list.
41 */
42[[nodiscard]] static QJsonObject makeSchema(const QJsonObject& properties,
43 const QJsonArray& required)
44{
45 QJsonObject schema;
46 schema[QStringLiteral("type")] = QStringLiteral("object");
47 schema[QStringLiteral("properties")] = properties;
48 if (!required.isEmpty())
49 schema[QStringLiteral("required")] = required;
50
51 return schema;
52}
53
54/**
55 * @brief Reads channel, title, subtitle from params (all optional, default empty).

Calls 1

isEmptyMethod · 0.80

Tested by

no test coverage detected