Skip to content

Commit aed7acc

Browse files
committed
[FIX] Use correct plugins parameter
1 parent 4982578 commit aed7acc

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

holoplus_mocked_api/holoplus_mocked_api/app.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
from __future__ import annotations
22

3-
from typing import Any
3+
from typing import Sequence
44

55
import litestar
66
import litestar.openapi
77
from litestar.exceptions import HTTPException, NotFoundException
8+
from litestar.openapi.plugins import OpenAPIRenderPlugin
89

910
from .account_hololive_net import ROUTES as ACCOUNT_HOLOLIVE_NET_ROUTES
1011
from .exceptions import HoloplusException, exception_handler, litestar_monkey_patch, root_exception_handler
@@ -16,7 +17,7 @@
1617
from .v5 import ROUTES as V5_ROUTES
1718

1819

19-
def create_app(**kwargs: Any) -> litestar.Litestar:
20+
def create_app(render_plugins: Sequence[OpenAPIRenderPlugin] = tuple()) -> litestar.Litestar:
2021
litestar_monkey_patch()
2122
return litestar.Litestar(
2223
route_handlers=[
@@ -32,12 +33,12 @@ def create_app(**kwargs: Any) -> litestar.Litestar:
3233
title="Holoplus API (Mocked)",
3334
version="3.0.0",
3435
use_handler_docstrings=True,
36+
render_plugins=render_plugins,
3537
),
3638
exception_handlers={
3739
Exception: exception_handler,
3840
HTTPException: exception_handler,
3941
HoloplusException: exception_handler,
4042
NotFoundException: root_exception_handler,
4143
},
42-
**kwargs,
4344
)

holoplus_mocked_api/holoplus_mocked_api/build_redoc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
if __name__ == "__main__":
1111
logging.getLogger("httpx").setLevel(logging.ERROR)
1212

13-
with TestClient(app=create_app(plugins=[RedocRenderPlugin(version="latest")])) as client:
13+
with TestClient(app=create_app(render_plugins=[RedocRenderPlugin(version="latest")])) as client:
1414
response = client.get("/schema")
1515
print(response.text) # noqa: T201

0 commit comments

Comments
 (0)