Help typing for CustomizedPage #1159
Unanswered
vunhatchuong
asked this question in
Q&A
Replies: 1 comment 2 replies
-
For mypy fix should be: T = TypeVar("T")
PageOptionalParams: TypeAlias = CustomizedPage[Page[T], UseOptionalParams()]
@router.get(
"/",
dependencies=[Depends(pagination_ctx(PageOptionalParams[UserResponse]))])
async def get_all(db: AsyncSession = Depends(get_db) -> ResponseBase[PageOptionalParams[UserResponse]]:
err, users = await user_crud.get_all(db)
return create_response(error=err, data=users) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Error:
dependencies
Beta Was this translation helpful? Give feedback.
All reactions