From d73131bbec089d30de052b7240fbb01f002665c0 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Mon, 14 Feb 2022 14:34:25 +0000 Subject: [PATCH] Allow cancel of alert via API with no description The XML for an alerts requires a `` field. The XML for a `` may have a `` field populated (although we ignore the contents) but it may also be empty. This commit updates the schema to leave the all the validation to the view layer, which can decide when or when not to validate the content of the `` field. --- app/v2/broadcast/broadcast_schemas.py | 2 +- tests/app/v2/broadcast/sample_cap_xml_documents.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/v2/broadcast/broadcast_schemas.py b/app/v2/broadcast/broadcast_schemas.py index bd77df612..f7d97f8a2 100644 --- a/app/v2/broadcast/broadcast_schemas.py +++ b/app/v2/broadcast/broadcast_schemas.py @@ -52,7 +52,7 @@ post_broadcast_schema = { }, "content": { "type": "string", - "minLength": 1, + "minLength": 0, }, "web": { "type": "string", diff --git a/tests/app/v2/broadcast/sample_cap_xml_documents.py b/tests/app/v2/broadcast/sample_cap_xml_documents.py index d4e62bbb7..20a107261 100644 --- a/tests/app/v2/broadcast/sample_cap_xml_documents.py +++ b/tests/app/v2/broadcast/sample_cap_xml_documents.py @@ -54,7 +54,7 @@ WAINFLEET_CANCEL = """ Likely 2020-02-16T23:30:13-00:00 Environment Agency - Cancel Warning + https://flood-warning-information.service.gov.uk 0345 988 1188