Skip to content

Commit

Permalink
added to swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardKoschicek committed Oct 24, 2023
1 parent f8e3345 commit e879fd5
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 4 deletions.
2 changes: 1 addition & 1 deletion openatlas/api/resources/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion openatlas/api/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/',
Expand Down
76 changes: 76 additions & 0 deletions openatlas/api/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit e879fd5

Please sign in to comment.