mirror of
https://github.com/ilri/dspace-statistics-api.git
synced 2025-05-12 16:16:04 +02:00
Add Swagger UI on /swagger
This includes a Swagger UI with an OpenAPI 3.0 JSON schema for easy interactive demonstration and testing of the API. The JSON schema was created with the standalone swagger-editor. Includes tests to make sure that the /swagger and /docs/openapi.json paths are acce- ssible.
This commit is contained in:
@ -16,3 +16,21 @@ def test_get_docs(client):
|
||||
|
||||
assert isinstance(response.content, bytes)
|
||||
assert response.status_code == 200
|
||||
|
||||
|
||||
def test_get_openapi_json(client):
|
||||
"""Test requesting the OpenAPI JSON schema."""
|
||||
|
||||
response = client.simulate_get("/docs/openapi.json")
|
||||
|
||||
assert isinstance(response.content, bytes)
|
||||
assert response.status_code == 200
|
||||
|
||||
|
||||
def test_get_swagger_ui(client):
|
||||
"""Test requesting the Swagger UI."""
|
||||
|
||||
response = client.simulate_get("/swagger")
|
||||
|
||||
assert isinstance(response.content, bytes)
|
||||
assert response.status_code == 200
|
||||
|
Reference in New Issue
Block a user