All quizzesMedium
Dependency Graphs & Reuse — Series 3
Preview — 3 of 10 questions
A dependency declares region: str = Header(default="eu"); the route itself has no region parameter. Can OpenAPI list this header for the route?
ANo, only route function parameters appear
BYes, FastAPI includes dependency inputs in the operation schema
COnly after the route has been called once
DOnly if the dependency returns a string
A reusable alias is defined as CurrentUser = Annotated[User, Depends(get_user)]. What does using user: CurrentUser on two routes reuse?
AOne user object across all requests
BThe same response body
CThe declaration of type and dependency
DA single route registration
A dependency uses Header(alias="X-Tenant-ID"). Which incoming header does it read?
AX-Tenant-ID
Balias
CHeader
DThe route's path name
Sign up free to play
Answer all 10 questions (7 more), see explanations for every answer, and track your score.