All quizzesHard
Advanced Dependency Graphs — Series 3
Preview — 3 of 10 questions
A security dependency is reached through Security(get_user, scopes=["read"]) on one branch and Security(get_user, scopes=["write"]) on another. What must authorization account for?
AOnly the first branch, because later declarations are ignored
BThe scope requirements associated with each dependency path
COnly scopes named in the response model
DNo scope checks; FastAPI validates token grants automatically
A common sub-dependency returns a mutable request context consumed by two branches. With default caching, what design assumption is safe?
AEach branch receives a separate copy
BThe context is shared across every request forever
CMutations in one branch cannot affect the other
DBoth branches may see the same object within that request
A dependency callable is wrapped in a new function and only the wrapper is passed to Depends. Which key must a test override to replace that route dependency?
AThe wrapper callable registered with Depends
BThe original function that the wrapper internally calls
CThe route's URL string
DThe generated OpenAPI operation ID
Sign up free to play
Answer all 10 questions (7 more), see explanations for every answer, and track your score.