From 6517867ab73a304f70baadb49366ae7492bd7355 Mon Sep 17 00:00:00 2001
From: Trishna Saeharaseelan <trishna.saeharaseelan@noc.ac.uk>
Date: Thu, 16 Mar 2023 16:09:26 +0000
Subject: [PATCH] refactor(encoded schema): update mime_type examples and
 description for is_binary

---
 .../mission_plan_encoded.json                        |  1 +
 .../autonomy_engine_adapter/observation_encoded.json |  3 ++-
 .../platform_status_encoded.json                     |  3 ++-
 formats/encoded.py                                   |  7 +++++--
 project/soar/swagger.json                            | 12 ++++++------
 5 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/examples/autonomy_engine_adapter/mission_plan_encoded.json b/examples/autonomy_engine_adapter/mission_plan_encoded.json
index e0a213a..bfd489d 100644
--- a/examples/autonomy_engine_adapter/mission_plan_encoded.json
+++ b/examples/autonomy_engine_adapter/mission_plan_encoded.json
@@ -12,6 +12,7 @@
     "message_type": "mission_plan_encoded",
     "data": "SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBlB/tRYQW3nez5HWYFBAAD+zwBySUAAAADVek72v1N2lUQAAAABAQAAAAAAAAAAAAAAAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==",
     "file_name": "ah1_03837434286438.sbd",
+    "mime_type": "application/gzip",
     "is_binary": true
    }
 }   
diff --git a/examples/autonomy_engine_adapter/observation_encoded.json b/examples/autonomy_engine_adapter/observation_encoded.json
index 5305a1f..1bf9162 100644
--- a/examples/autonomy_engine_adapter/observation_encoded.json
+++ b/examples/autonomy_engine_adapter/observation_encoded.json
@@ -11,7 +11,8 @@
   "payload": {
     "message_type": "observation_encoded",
     "data": "T1N2lUQAAAABAQAAAAAAAAAAAAAAAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==",
-    "file_name": "ecosub1_200002114.txt",
+    "file_name": "ecosub1_200002114.bin",
+    "mime_type": "application/gzip",
     "is_binary": true
    }
 }   
diff --git a/examples/autonomy_engine_adapter/platform_status_encoded.json b/examples/autonomy_engine_adapter/platform_status_encoded.json
index 52ec489..0b12154 100644
--- a/examples/autonomy_engine_adapter/platform_status_encoded.json
+++ b/examples/autonomy_engine_adapter/platform_status_encoded.json
@@ -10,8 +10,9 @@
   },
   "payload": {
     "message_type": "platform_status_encoded",
-    "data": "SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcBlB/tRYQW3nez5HWYFBAAD+zwBySUAAAADVek72v1N2lUQAAAABAQAAAAAAAAAAAAAAAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==",
+    "data": "HWYFBAAD+zwBySUAAAADVek72v1N2lUQAAAABAQAAAAAAAAAAAAAAAAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==",
     "file_name": "ah1_03837434286438.sbd",
+    "mime_type": "application/gzip",
     "is_binary": true
    }
 }   
diff --git a/formats/encoded.py b/formats/encoded.py
index a8b244a..1818c1b 100644
--- a/formats/encoded.py
+++ b/formats/encoded.py
@@ -34,11 +34,14 @@ encoded_schema = {
         "mime_type": {
             "type": "string",
             "description": "MIME type",
-            "example": "",  # TODO: Add example
+            "example": "application/gzip",
         },
         "is_binary": {
             "type": "boolean",
-            "description": "Base64 encrypted binary data",
+            "description": (
+                "True if the data field contains binary format data encoded as base64."
+                + " False if the data field contains ascii content such as NMEA."
+            ),
             "example": True,
         },
     },
diff --git a/project/soar/swagger.json b/project/soar/swagger.json
index b6f32e7..dcaee9e 100644
--- a/project/soar/swagger.json
+++ b/project/soar/swagger.json
@@ -207,7 +207,7 @@
                   "type":"string"
                },
                "is_binary":{
-                  "description":"Base64 encrypted binary data",
+                  "description":"True if the data field contains binary format data encoded as base64. False if the data field contains ascii content such as NMEA.",
                   "example":true,
                   "type":"boolean"
                },
@@ -223,7 +223,7 @@
                },
                "mime_type":{
                   "description":"MIME type",
-                  "example":"",
+                  "example":"application/gzip",
                   "type":"string"
                }
             },
@@ -311,7 +311,7 @@
                   "type":"string"
                },
                "is_binary":{
-                  "description":"Base64 encrypted binary data",
+                  "description":"True if the data field contains binary format data encoded as base64. False if the data field contains ascii content such as NMEA.",
                   "example":true,
                   "type":"boolean"
                },
@@ -327,7 +327,7 @@
                },
                "mime_type":{
                   "description":"MIME type",
-                  "example":"",
+                  "example":"application/gzip",
                   "type":"string"
                }
             },
@@ -795,7 +795,7 @@
                   "type":"string"
                },
                "is_binary":{
-                  "description":"Base64 encrypted binary data",
+                  "description":"True if the data field contains binary format data encoded as base64. False if the data field contains ascii content such as NMEA.",
                   "example":true,
                   "type":"boolean"
                },
@@ -811,7 +811,7 @@
                },
                "mime_type":{
                   "description":"MIME type",
-                  "example":"",
+                  "example":"application/gzip",
                   "type":"string"
                }
             },
-- 
GitLab