All quizzesEasy
Routes & Request Validation — Series 2
Preview — 3 of 10 questions
Which declaration makes a query parameter q required?
Aq: Optional[str] = None
Bq: str
Cq: str = None
Dq: str = ""
What does Body(embed=True) change for a single Pydantic body parameter named item?
AIt expects JSON under an item key
BIt reads item from the URL path
CIt converts the body to form data
DIt makes every model field optional
A route accepts model: ModelName, where ModelName is a Python Enum used in the path. What happens for a value outside the enum?
AThe value is silently changed to the first member
BThe route is removed from OpenAPI
CThe value becomes a query parameter
DThe request fails validation
Sign up free to play
Answer all 10 questions (7 more), see explanations for every answer, and track your score.