Skip to content

Commit e3564a5

Browse files
committed
Move asyncapi documentation endpoint
1 parent d1b5354 commit e3564a5

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

docs/api-documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on `/docs` and `/redoc` paths using OpenAPI format.
55

66
AsyncAPI documentation is rendered using the
77
[AsyncAPI react components](https://github.com/asyncapi/asyncapi-react).
8-
It is available on `/docs/ws` path.
8+
It is available on `/asyncapi` path.
99

1010
## API versioning
1111

src/http_app/routes/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from http_app.routes import (
44
api,
5-
docs_ws,
5+
asyncapi,
66
events,
77
graphql,
88
hello,
@@ -15,7 +15,7 @@
1515

1616
def init_routes(app: FastAPI) -> None:
1717
app.include_router(api.router)
18-
app.include_router(docs_ws.router)
18+
app.include_router(asyncapi.router)
1919
app.include_router(ping.router)
2020
app.include_router(hello.router)
2121
app.include_router(events.router)

src/http_app/routes/docs_ws.py renamed to src/http_app/routes/asyncapi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from common.asyncapi import get_schema
1111
from http_app.dependencies import get_app_config
1212

13-
router = APIRouter(prefix="/docs/ws")
13+
router = APIRouter(prefix="/asyncapi")
1414

1515

1616
@router.get(
@@ -49,7 +49,7 @@ async def get_asyncapi_html(
4949
"""Generate HTML for displaying an AsyncAPI document."""
5050
config = {
5151
"schema": {
52-
"url": "/docs/ws/asyncapi.json",
52+
"url": "/asyncapi/asyncapi.json",
5353
},
5454
"config": {
5555
"show": {

tests/http_app/routes/test_docs_ws.py renamed to tests/http_app/routes/test_asyncapi.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
)
1616

1717

18-
@patch("http_app.routes.docs_ws.get_schema", return_value=fake_schema)
18+
@patch("http_app.routes.asyncapi.get_schema", return_value=fake_schema)
1919
async def test_asyncapi_json_is_whatever_returned_by_schema(
2020
mock_schema: MagicMock,
2121
testapp: FastAPI,
2222
):
2323
ac = TestClient(app=testapp, base_url="http://test")
2424
response = ac.get(
25-
"/docs/ws/asyncapi.json",
25+
"/asyncapi/asyncapi.json",
2626
)
2727

2828
assert response.status_code == status.HTTP_200_OK
@@ -51,7 +51,7 @@ async def test_ws_docs_renders_config_based_on_params(
5151
config = json.dumps(
5252
{
5353
"schema": {
54-
"url": "/docs/ws/asyncapi.json",
54+
"url": "/asyncapi/asyncapi.json",
5555
},
5656
"config": {
5757
"show": {
@@ -76,7 +76,7 @@ async def test_ws_docs_renders_config_based_on_params(
7676

7777
ac = TestClient(app=testapp, base_url="http://test")
7878
response = ac.get(
79-
"/docs/ws",
79+
"/asyncapi",
8080
params={
8181
"sidebar": sidebar,
8282
"info": info,

0 commit comments

Comments
 (0)