From bd0feb64aad1feb365e29b6558f4a3b8c6158fd3 Mon Sep 17 00:00:00 2001
From: Dan Jones <dan.jones@noc.ac.uk>
Date: Thu, 23 Feb 2023 09:25:20 +0000
Subject: [PATCH] fix: assign schema to this.schema not promise

---
 dist/protocol.esm.js  | 4 ++--
 dist/protocol.js      | 4 ++--
 src/protocol/index.js | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/dist/protocol.esm.js b/dist/protocol.esm.js
index 0132583..725de27 100644
--- a/dist/protocol.esm.js
+++ b/dist/protocol.esm.js
@@ -135,11 +135,11 @@ class GenericSoarProtocol extends GenericProtocol {
     let repository = "https://git.noc.ac.uk/communications-backbone-system/backbone-message-format";
     // TODO check this path resolves for tags
     let url = `${repository}/-/raw/${version}/project/soar/swagger.json`;
-    this.schema = this.axios.get(url)
+    return this.axios.get(url)
     .then((response) => {
+      this.schema = response.data;
       return response.data;
     });
-    return this.schema;
   }
 
   /**
diff --git a/dist/protocol.js b/dist/protocol.js
index d75a073..e91ec20 100644
--- a/dist/protocol.js
+++ b/dist/protocol.js
@@ -137,11 +137,11 @@ class GenericSoarProtocol extends GenericProtocol {
     let repository = "https://git.noc.ac.uk/communications-backbone-system/backbone-message-format";
     // TODO check this path resolves for tags
     let url = `${repository}/-/raw/${version}/project/soar/swagger.json`;
-    this.schema = this.axios.get(url)
+    return this.axios.get(url)
     .then((response) => {
+      this.schema = response.data;
       return response.data;
     });
-    return this.schema;
   }
 
   /**
diff --git a/src/protocol/index.js b/src/protocol/index.js
index ad7d386..5f65b22 100644
--- a/src/protocol/index.js
+++ b/src/protocol/index.js
@@ -135,11 +135,11 @@ export class GenericSoarProtocol extends GenericProtocol {
     let repository = "https://git.noc.ac.uk/communications-backbone-system/backbone-message-format";
     // TODO check this path resolves for tags
     let url = `${repository}/-/raw/${version}/project/soar/swagger.json`;
-    this.schema = this.axios.get(url)
+    return this.axios.get(url)
     .then((response) => {
+      this.schema = response.data
       return response.data;
     });
-    return this.schema;
   }
 
   /**
-- 
GitLab