From fa701dd52f420c2d884723f2ab42a2e3323cbc19 Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Tue, 17 Sep 2024 10:56:38 +0200 Subject: [PATCH] fix(userspace/engine): improve rule json schema to account for `source` and `required_plugin_versions`. Signed-off-by: Federico Di Pierro --- userspace/engine/rule_json_schema.h | 49 +++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/userspace/engine/rule_json_schema.h b/userspace/engine/rule_json_schema.h index ae0541aa431..189f290b27d 100644 --- a/userspace/engine/rule_json_schema.h +++ b/userspace/engine/rule_json_schema.h @@ -35,6 +35,12 @@ const char rule_schema_string[] = LONG_STRING_CONST( "required_engine_version": { "type": "string" }, + "required_plugin_versions": { + "type": "array", + "items": { + "$ref": "#/definitions/RequiredPluginVersion" + } + }, "macro": { "type": "string" }, @@ -68,6 +74,9 @@ const char rule_schema_string[] = LONG_STRING_CONST( "priority": { "$ref": "#/definitions/Priority" }, + "source": { + "type": "string" + }, "exceptions": { "type": "array", "items": { @@ -166,6 +175,46 @@ const char rule_schema_string[] = LONG_STRING_CONST( }, "minProperties": 1, "title": "Override" + }, + "RequiredPluginVersion": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "alternatives": { + "type": "array", + "items": { + "$ref": "#/definitions/Alternative" + } + } + }, + "required": [ + "name", + "version" + ], + "title": "RequiredPluginVersion" + }, + "Alternative": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "required": [ + "name", + "version" + ], + "title": "Alternative" } } }