APIRouter: unexpected keyword argument 'prefix' #6995
-
First check
IssueI was following the official tutorial related to bigger applications and came across a Examples: TypeError: __init__() got an unexpected keyword argument 'prefix'
TypeError: __init__() got an unexpected keyword argument 'tags'
TypeError: __init__() got an unexpected keyword argument 'responses'Code used: router = APIRouter(
prefix="/items",
tags=["items"],
dependencies=[Depends(get_token_header)],
responses={404: {"description": "Not found"}},
)However, I noticed that each of the argument works if I use them in app.include_router(
admin.router,
prefix="/admin",
tags=["admin"],
dependencies=[Depends(get_token_header)],
responses={418: {"description": "I'm a teapot"}},
)Is this an issue in documentation or code? Environment
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
You are looking at documentation for the current version, 0.63.0. Please update if you wish to use those features |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @Mause - It worked. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the help here @Mause ! 👏 🙇 Thanks for reporting back and closing the issue @jintolonappan 👍
|
Beta Was this translation helpful? Give feedback.
You are looking at documentation for the current version, 0.63.0. Please update if you wish to use those features