New: Intelligent Flashcards spaced-repetition decks for every topic, built to make things actually stick.
A route declares q: Annotated[str | None, Query(min_length=3)] = None. What happens if a client sends q=ab?
q: Annotated[str | None, Query(min_length=3)] = None
q=ab
FastAPI silently stretches the value by adding characters until it reaches the three character minimum you configured.
FastAPI accepts ab unchanged since it is still a valid string.
ab
FastAPI rejects the request and returns a 422 error before your code runs.