From ec8c4a21caae5a5e7845d91e74628f6a64ef2fb3 Mon Sep 17 00:00:00 2001 From: Jorge Andres Herrera Maldonado Date: Wed, 24 Nov 2021 16:56:52 +0100 Subject: [PATCH] Documentation for 400 HTTP responses --- .../apidocs/stac_collections_docs.py | 15 ++++++++- .../apidocs/stac_collections_id_docs.py | 33 +++++++++++++++++-- .../apidocs/stac_instances_docs.py | 15 ++++++++- .../apidocs/stac_instances_id_docs.py | 30 +++++++++++++++-- 4 files changed, 87 insertions(+), 6 deletions(-) diff --git a/actinia_stac_plugin/apidocs/stac_collections_docs.py b/actinia_stac_plugin/apidocs/stac_collections_docs.py index 3685ba2..5b3a7b4 100644 --- a/actinia_stac_plugin/apidocs/stac_collections_docs.py +++ b/actinia_stac_plugin/apidocs/stac_collections_docs.py @@ -64,6 +64,19 @@ "responses": { "200": { "description": "This response returns a message with the STAC collection successfully added" - } + }, + "400": { + "description": "This response returns a detail error message", + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "detailed message", + "example": "Please check the URL provided (Should be a STAC Collection)", + } + }, + }, + }, }, } diff --git a/actinia_stac_plugin/apidocs/stac_collections_id_docs.py b/actinia_stac_plugin/apidocs/stac_collections_id_docs.py index 7236d7c..3cee4d0 100644 --- a/actinia_stac_plugin/apidocs/stac_collections_id_docs.py +++ b/actinia_stac_plugin/apidocs/stac_collections_id_docs.py @@ -38,7 +38,22 @@ "required": True, } ], - "responses": {"200": {"description": "This response returns a STAC collection"}}, + "responses": { + "200": {"description": "This response returns a STAC collection"}, + "400": { + "description": "This response returns a detail error message", + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "detailed message", + "example": "Please check the collection id provide", + } + }, + }, + }, + }, } staccollection_id_delete_docs = { @@ -56,6 +71,20 @@ "responses": { "200": { "description": "This response returns a message with the STAC collection successfully deleted" - } + }, + "400": { + "description": "This response returns a detail error message", + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "detailed message", + "example": "stac_collection_id does not match the pattern " + + "stac..rastercube.