From 6ae2593a2550be9093981cfa2ec72a81a0db1168 Mon Sep 17 00:00:00 2001
From: "Austin S. Hemmelgarn" <austin@netdata.cloud>
Date: Mon, 31 Jul 2023 08:04:52 -0400
Subject: [PATCH] Fix exporter schema to support multiple entries per file.
 (#15649)

---
 integrations/schemas/exporter.json | 79 ++++++++++++++++++------------
 1 file changed, 47 insertions(+), 32 deletions(-)

diff --git a/integrations/schemas/exporter.json b/integrations/schemas/exporter.json
index 99cf64e1f6..4904fe2326 100644
--- a/integrations/schemas/exporter.json
+++ b/integrations/schemas/exporter.json
@@ -1,44 +1,59 @@
 {
   "$schema": "http://json-schema.org/draft-07/schema#",
-  "type": "object",
   "title": "Netdata Agent data exporter metadata.",
-  "properties": {
-    "id": {
-      "$ref": "./shared.json#/$defs/id"
+  "oneOf": [
+    {
+      "$ref": "#/$defs/entry"
     },
-    "meta": {
-      "$ref": "./shared.json#/$defs/instance"
-    },
-    "keywords": {
-      "$ref": "./shared.json#/$defs/keywords"
-    },
-    "overview": {
-      "type": "object",
-      "description": "General information about the exporter.",
+    {
+      "type": "array",
+      "minLength": 1,
+      "items": {
+        "$ref": "#/$defs/entry"
+      }
+    }
+  ],
+  "$defs": {
+    "entry": {
       "properties": {
-        "exporter_description": {
-          "type": "string",
-          "description": "General description of what the exporter does."
+        "id": {
+          "$ref": "./shared.json#/$defs/id"
         },
-        "exporter_limitations": {
-          "type": "string",
-          "description": "Explanation of any limitations of the exporter."
+        "meta": {
+          "$ref": "./shared.json#/$defs/instance"
+        },
+        "keywords": {
+          "$ref": "./shared.json#/$defs/keywords"
+        },
+        "overview": {
+          "type": "object",
+          "description": "General information about the exporter.",
+          "properties": {
+            "exporter_description": {
+              "type": "string",
+              "description": "General description of what the exporter does."
+            },
+            "exporter_limitations": {
+              "type": "string",
+              "description": "Explanation of any limitations of the exporter."
+            }
+          },
+          "required": [
+            "exporter_description",
+            "exporter_limitations"
+          ]
+        },
+        "setup": {
+          "$ref": "./shared.json#/$defs/full_setup"
         }
       },
       "required": [
-        "exporter_description",
-        "exporter_limitations"
+        "id",
+        "meta",
+        "keywords",
+        "overview",
+        "setup"
       ]
-    },
-    "setup": {
-      "$ref": "./shared.json#/$defs/full_setup"
     }
-  },
-  "required": [
-    "id",
-    "meta",
-    "keywords",
-    "overview",
-    "setup"
-  ]
+  }
 }