From b0decdfd804f5af4d814e633c07d591ba297a506 Mon Sep 17 00:00:00 2001 From: Calum Macdonald Date: Tue, 3 Oct 2023 11:58:06 +0100 Subject: [PATCH] allow gwdm observations to be null --- hdr_schemata/models/GWDM/1.0/schema.json | 17 ++++++++++++----- hdr_schemata/models/GWDM/base/__init__.py | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/hdr_schemata/models/GWDM/1.0/schema.json b/hdr_schemata/models/GWDM/1.0/schema.json index e157e92..814340b 100644 --- a/hdr_schemata/models/GWDM/1.0/schema.json +++ b/hdr_schemata/models/GWDM/1.0/schema.json @@ -1420,13 +1420,20 @@ "title": "Linkage" }, "observations": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Observation" + }, + "type": "array" + }, + { + "type": "null" + } + ], "default": null, "description": "Obsservations", - "items": { - "$ref": "#/$defs/Observation" - }, - "title": "Observations", - "type": "array" + "title": "Observations" }, "structuralMetadata": { "anyOf": [ diff --git a/hdr_schemata/models/GWDM/base/__init__.py b/hdr_schemata/models/GWDM/base/__init__.py index 8bdc15b..4275bbb 100644 --- a/hdr_schemata/models/GWDM/base/__init__.py +++ b/hdr_schemata/models/GWDM/base/__init__.py @@ -55,7 +55,7 @@ class Config: title='Linkage', ) - observations: List[Observation] = Field( + observations: Optional[List[Observation]] = Field( None, description='Obsservations', title='Observations',