Skip to content

Commit d36d7ee

Browse files
committed
fix(userspace/engine): improve rule json schema to account for source and required_plugin_versions.
Signed-off-by: Federico Di Pierro <[email protected]>
1 parent 6b634df commit d36d7ee

File tree

1 file changed

+50
-1
lines changed

1 file changed

+50
-1
lines changed

userspace/engine/rule_json_schema.h

+50-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ const char rule_schema_string[] = LONG_STRING_CONST(
3535
"required_engine_version": {
3636
"type": "string"
3737
},
38+
"required_plugin_versions": {
39+
"type": "array",
40+
"items": {
41+
"$ref": "#/definitions/RequiredPluginVersion"
42+
}
43+
},
3844
"macro": {
3945
"type": "string"
4046
},
@@ -68,6 +74,9 @@ const char rule_schema_string[] = LONG_STRING_CONST(
6874
"priority": {
6975
"$ref": "#/definitions/Priority"
7076
},
77+
"source": {
78+
"type": "string"
79+
},
7180
"exceptions": {
7281
"type": "array",
7382
"items": {
@@ -166,7 +175,47 @@ const char rule_schema_string[] = LONG_STRING_CONST(
166175
},
167176
"minProperties": 1,
168177
"title": "Override"
169-
}
178+
},
179+
"RequiredPluginVersion": {
180+
"type": "object",
181+
"additionalProperties": false,
182+
"properties": {
183+
"name": {
184+
"type": "string"
185+
},
186+
"version": {
187+
"type": "string"
188+
},
189+
"alternatives": {
190+
"type": "array",
191+
"items": {
192+
"$ref": "#/definitions/Alternative"
193+
}
194+
}
195+
},
196+
"required": [
197+
"name",
198+
"version"
199+
],
200+
"title": "RequiredPluginVersion"
201+
},
202+
"Alternative": {
203+
"type": "object",
204+
"additionalProperties": false,
205+
"properties": {
206+
"name": {
207+
"type": "string"
208+
},
209+
"version": {
210+
"type": "string"
211+
}
212+
},
213+
"required": [
214+
"name",
215+
"version"
216+
],
217+
"title": "Alternative"
218+
}
170219
}
171220
}
172221

0 commit comments

Comments
 (0)