From e6337ba6373c4d4a094cc731f1c7ca867b7c34b0 Mon Sep 17 00:00:00 2001
From: Jorrit Schaap <schaap@astron.nl>
Date: Tue, 23 Feb 2021 21:14:48 +0100
Subject: [PATCH] TMSS-528: enforce at least one SAP

---
 .../tmssapp/schemas/common_schema_template-stations-1.json     | 3 ++-
 .../schemas/task_template-beamforming_observation-1.json       | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/common_schema_template-stations-1.json b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/common_schema_template-stations-1.json
index 3a634e6cb3f..3c1082edf04 100644
--- a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/common_schema_template-stations-1.json
+++ b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/common_schema_template-stations-1.json
@@ -345,7 +345,8 @@
       "title": "SAPs",
       "description": "Station beams",
       "additionalItems": false,
-      "default": [],
+      "default": [{}],
+      "minItems": 1,
       "items": {
         "title": "SAP",
         "headerTemplate": "{{ i0 }} - {{ self.name }}",
diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/task_template-beamforming_observation-1.json b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/task_template-beamforming_observation-1.json
index ec3c02c3df1..ca6183d9b0b 100644
--- a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/task_template-beamforming_observation-1.json
+++ b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/task_template-beamforming_observation-1.json
@@ -60,7 +60,8 @@
       "$ref": "http://tmss.lofar.org/api/schemas/commonschematemplate/pointing/1/#/definitions/pointing"
     },
     "SAPs": {
-      "$ref": "http://tmss.lofar.org/api/schemas/commonschematemplate/stations/1/#/definitions/SAPs"
+      "$ref": "http://tmss.lofar.org/api/schemas/commonschematemplate/stations/1/#/definitions/SAPs",
+      "default": [{}]
     },
     "duration": {
       "$id": "#duration",
-- 
GitLab