Skip to content

Commit eb23aef

Browse files
committed
♻️(back) use same base route path for swagger
Swaggers urls where not using the same base route path /api/v1.0, we prepend it to have the same path everywhere. Moreover, a double slash was used for swagger and redoc dashboard.
1 parent 0c49019 commit eb23aef

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/backend/core/tests/swagger/test_openapi_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_openapi_client_schema():
3333
)
3434
assert output.getvalue() == ""
3535

36-
response = Client().get("/v1.0/swagger.json")
36+
response = Client().get("/api/v1.0/swagger.json")
3737

3838
assert response.status_code == 200
3939
with open(

src/backend/impress/urls.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@
2828
if settings.USE_SWAGGER or settings.DEBUG:
2929
urlpatterns += [
3030
path(
31-
f"{settings.API_VERSION}/swagger.json",
31+
f"api/{settings.API_VERSION}/swagger.json",
3232
SpectacularJSONAPIView.as_view(
3333
api_version=settings.API_VERSION,
3434
urlconf="core.urls",
3535
),
3636
name="client-api-schema",
3737
),
3838
path(
39-
f"{settings.API_VERSION}//swagger/",
39+
f"api/{settings.API_VERSION}/swagger/",
4040
SpectacularSwaggerView.as_view(url_name="client-api-schema"),
4141
name="swagger-ui-schema",
4242
),
4343
re_path(
44-
f"{settings.API_VERSION}//redoc/",
44+
f"api/{settings.API_VERSION}/redoc/",
4545
SpectacularRedocView.as_view(url_name="client-api-schema"),
4646
name="redoc-schema",
4747
),

0 commit comments

Comments
 (0)