Overview
Query
Extract URL query parameters
Path
Extract path parameters
Body
Extract request body data
Header
Extract HTTP headers
Cookie
Extract cookies
Form
Extract form data
File
Extract file uploads
Query
Extract and validate URL query parameters.Parameters
Default value if parameter is not provided
Alternative name for the parameter in the URL
Title for API documentation
Description for API documentation
Greater than validation for numeric values
Greater than or equal validation for numeric values
Less than validation for numeric values
Less than or equal validation for numeric values
Minimum length for string values
Maximum length for string values
Regex pattern for string validation
Mark parameter as deprecated in API documentation
Whether to include in OpenAPI schema
Example values for API documentation
Example
Path
Extract and validate path parameters from URL paths.Parameters
Path accepts the same parameters as Query (see above).Example
Body
Extract and validate request body data.Parameters
Default value if body is not provided
Whether to expect the body to be embedded under a key
Expected media type of the body
Alternative name for the body parameter
Title for API documentation
Description for API documentation
Example
Header
Extract and validate HTTP headers.Parameters
Header accepts similar parameters to Query for validation.Example
Cookie
Extract and validate cookies.Parameters
Cookie accepts similar parameters to Query for validation.Example
Form
Extract form data fromapplication/x-www-form-urlencoded or multipart/form-data requests.
Parameters
Form accepts similar parameters to Query for validation.Example
File
Extract file uploads from multipart form data.Parameters
Default value if file is not provided
Description for API documentation
Example
Validation
All parameter classes support validation constraints:- Numeric validation:
gt,ge,lt,le - String validation:
min_length,max_length,pattern - Documentation:
title,description,examples,deprecated
422 Unprocessable Entity response with details about the validation errors.
Related resources
Request handling
Understand request processing
Pydantic validation
Use Pydantic models for validation
UploadFile
Handle file uploads
Dependencies
Dependency injection system