diff --git a/openatlas/api/resources/templates.py b/openatlas/api/resources/templates.py index 3db02a89e..1875af7be 100644 --- a/openatlas/api/resources/templates.py +++ b/openatlas/api/resources/templates.py @@ -311,7 +311,7 @@ def content_template() -> dict[str, Type[String]]: def backend_details_template() -> dict[str, Type[String]]: image_processing = { 'enabled': fields.String, - 'availableImageSizes': fields.String} + 'availableImageSizes': fields.Raw} iiif = { 'enabled': fields.String, 'url': fields.String, diff --git a/openatlas/api/routes.py b/openatlas/api/routes.py index ffd835c3a..0bb0ad65c 100644 --- a/openatlas/api/routes.py +++ b/openatlas/api/routes.py @@ -77,7 +77,7 @@ def add_routes_v03(api: Api) -> None: api.add_resource( GetBackendDetails, '/backend_details/', - endpoint="backend_detail") + endpoint="backend_details") api.add_resource( ClassMapping, '/classes/', diff --git a/openatlas/api/swagger.json b/openatlas/api/swagger.json index 6b88f92f4..38d217816 100644 --- a/openatlas/api/swagger.json +++ b/openatlas/api/swagger.json @@ -850,6 +850,35 @@ } } }, + "/backend_details/": { + "get": { + "tags": [ + "Administrative Endpoints" + ], + "description": "Retrieves a list of information of the backend configuration.", + "operationId": "GetBackendDetails", + "parameters": [ + { + "$ref": "#/components/parameters/download" + } + ], + "responses": { + "200": { + "description": "OpenAtlas backend details", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BackendDetailsModel" + } + } + } + }, + "404": { + "description": "Something went wrong. Please consult the error message." + } + } + } + }, "/system_class_count/": { "get": { "tags": [ @@ -2357,6 +2386,53 @@ } } }, + "BackendDetailsModel": { + "type": "object", + "properties": { + "version": { + "type": "string" + }, + "apiVersions": { + "type": "string" + }, + "siteName": { + "type": "string" + }, + "imageProcessing": { + "type": "object", + "properties": { + "enabled": { + "type": "string" + }, + "availableImageSizes": { + "type": "object", + "properties": { + "thumbnail": { + "type": "string" + }, + "table": { + "type": "string" + } + } + } + } + }, + "IIIF": { + "type": "object", + "properties": { + "enabled": { + "type": "string" + }, + "url": { + "type": "string" + }, + "version": { + "type": "string" + } + } + } + } + }, "SystemClassCountModel": { "type": "object", "properties": { diff --git a/tests/test_api.py b/tests/test_api.py index 2b8698606..3df11952c 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -84,10 +84,10 @@ def test_api(self) -> None: rv = self.app.get(url_for('api_03.content')).get_json() assert bool(rv['intro'] == 'This is English') - rv = self.app.get(url_for('api_03.backend_detail')).get_json() + rv = self.app.get(url_for('api_03.backend_details')).get_json() assert bool(rv['version'] == app.config['VERSION']) rv = self.app.get( - url_for('api_03.backend_detail', download=True)).get_json() + url_for('api_03.backend_details', download=True)).get_json() assert bool(rv['version'] == app.config['VERSION']) rv = self.app.get(url_for('api_03.system_class_count')).get_json()