From 783595aa10f93208c387b0b7be5a16bc07da9400 Mon Sep 17 00:00:00 2001 From: hos Date: Sat, 18 Jul 2026 21:29:20 +0100 Subject: [PATCH] Clarify query parameter validation behavior --- docs/en/docs/tutorial/query-params.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/en/docs/tutorial/query-params.md b/docs/en/docs/tutorial/query-params.md index cb89e23e7..50a9d2847 100644 --- a/docs/en/docs/tutorial/query-params.md +++ b/docs/en/docs/tutorial/query-params.md @@ -20,6 +20,11 @@ http://127.0.0.1:8000/items/?skip=0&limit=10 As they are part of the URL, they are "naturally" strings. But when you declare them with Python types (in the example above, as `int`), they are converted to that type and validated against it. +For example, if `skip` is declared as an `int`, sending a value that cannot be converted to an integer: +``` +http://127.0.0.1:8000/items/?skip=abc +``` +will result in a validation error because `"abc"` cannot be converted to an integer. All the same processes that apply to path parameters also apply to query parameters: