♻️(backend) prefix Swagger routes with /api

Inspired by commit eb23aef in suitenumerique/docs. The same base
route path is used everywhere, which helps when the backend sits
behind an ingress serving it with a regex like `api/*`.
This commit is contained in:
lebaudantoine
2026-05-30 18:54:53 +02:00
committed by aleb_the_flash
parent 88b722e741
commit 4d27f217fc
3 changed files with 7 additions and 6 deletions
@@ -34,7 +34,7 @@ def test_openapi_client_schema():
)
assert output.getvalue() == ""
response = Client().get("/v1.0/swagger.json")
response = Client().get("/api/v1.0/swagger.json")
assert response.status_code == 200
with open(
@@ -52,8 +52,8 @@ def test_openapi_documentation_routes(mock_staticfiles):
"""Swagger and ReDoc documentation should be served on canonical URLs."""
client = Client()
swagger_response = client.get("/v1.0/swagger/")
redoc_response = client.get("/v1.0/redoc/")
swagger_response = client.get("/api/v1.0/swagger/")
redoc_response = client.get("/api/v1.0/redoc/")
assert swagger_response.status_code == 200
assert redoc_response.status_code == 200