Fix exporter schema to support multiple entries per file. (#15649)
Austin S. Hemmelgarn committed
Jul 31, 2023 at 08:04 UTC
6ae2593a2550be9093981cfa2ec72a81a0db1168
1 file changed
+47
-32
integrations/schemas/exporter.json
+47
-32
@@ -1,44 +1,59 @@
1
{
2
"$schema": "http://json-schema.org/draft-07/schema#",
3
- "type": "object",
3
"title": "Netdata Agent data exporter metadata.",
5
- "properties": {
6
- "id": {
7
- "$ref": "./shared.json#/$defs/id"
4
+ "oneOf": [
5
+ {
6
+ "$ref": "#/$defs/entry"
7
},
9
- "meta": {
10
- "$ref": "./shared.json#/$defs/instance"
11
- },
12
- "keywords": {
13
- "$ref": "./shared.json#/$defs/keywords"
14
- },
15
- "overview": {
16
- "type": "object",
17
- "description": "General information about the exporter.",
8
+ {
9
+ "type": "array",
10
+ "minLength": 1,
11
+ "items": {
12
+ "$ref": "#/$defs/entry"
13
+ }
14
+ }
15
+ ],
16
+ "$defs": {
17
+ "entry": {
18
"properties": {
19
- "exporter_description": {
20
- "type": "string",
21
- "description": "General description of what the exporter does."
19
+ "id": {
20
+ "$ref": "./shared.json#/$defs/id"
21
+ },
22
+ "meta": {
23
+ "$ref": "./shared.json#/$defs/instance"
24
},
23
- "exporter_limitations": {
24
- "type": "string",
25
- "description": "Explanation of any limitations of the exporter."
25
+ "keywords": {
26
+ "$ref": "./shared.json#/$defs/keywords"
27
+ },
28
+ "overview": {
29
+ "type": "object",
30
+ "description": "General information about the exporter.",
31
+ "properties": {
32
+ "exporter_description": {
33
+ "type": "string",
34
+ "description": "General description of what the exporter does."
35
+ },
36
+ "exporter_limitations": {
37
+ "type": "string",
38
+ "description": "Explanation of any limitations of the exporter."
39
+ }
40
+ },
41
+ "required": [
42
+ "exporter_description",
43
+ "exporter_limitations"
44
+ ]
45
+ },
46
+ "setup": {
47
+ "$ref": "./shared.json#/$defs/full_setup"
48
}
49
},
50
"required": [
29
- "exporter_description",
30
- "exporter_limitations"
51
+ "id",
52
+ "meta",
53
+ "keywords",
54
+ "overview",
55
+ "setup"
56
]
32
- },
33
- "setup": {
34
- "$ref": "./shared.json#/$defs/full_setup"
57
}
36
- },
37
- "required": [
38
- "id",
39
- "meta",
40
- "keywords",
41
- "overview",
42
- "setup"
43
- ]
58
+ }
59
}