Skip to content

Commit 2e7c3ea

Browse files
authored
fix: correct typing issue in litestar example (#498)
fix typing issue in litestar example
1 parent 1bac830 commit 2e7c3ea

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/usage/frameworks/litestar.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,11 @@ Create a controller class to handle HTTP endpoints. The controller uses dependen
142142

143143
.. code-block:: python
144144
145+
from typing import Annotated
146+
145147
from litestar import Controller, get, post, patch, delete
146148
from litestar.di import Provide
147-
from litestar.params import Parameter
149+
from litestar.params import Dependency, Parameter
148150
from advanced_alchemy.filters import FilterTypes
149151
from advanced_alchemy.extensions.litestar.providers import create_service_dependencies
150152
from advanced_alchemy.service import OffsetPagination
@@ -164,7 +166,7 @@ Create a controller class to handle HTTP endpoints. The controller uses dependen
164166
async def list_authors(
165167
self,
166168
authors_service: AuthorService,
167-
filters: list[FilterTypes],
169+
filters: Annotated[list[FilterTypes], Dependency(skip_validation=True)],
168170
) -> OffsetPagination[Author]:
169171
"""List all authors with pagination."""
170172
results, total = await authors_service.list_and_count(*filters)

0 commit comments

Comments
 (0)