-
Notifications
You must be signed in to change notification settings - Fork 73
Input Validation
Thomas Pollet edited this page Mar 8, 2026
·
3 revisions
- Applies to: Flask and FastAPI
- Best sources:
safrs/errors.py,tests/test_fastapi_parity_semantics.py - Related pages: Content Types and Errors, Filtering, Troubleshooting
Validation can happen in several places:
- request parsing
- content-type handling
- filter parsing
- model constructors and hooks
- custom SQLAlchemy column types
User-facing validation failures should appear as JSON:API error documents, not arbitrary plain JSON blobs.
- invalid JSON payloads
- invalid filters
- invalid ids
- custom validation errors raised by column types or hooks
The FastAPI adapter maps request-shape validation failures to JSON:API 422 responses.
- Home
- Installation
- Quickstart (Flask)
- Quickstart (FastAPI)
- JSON:API Basics
- Relationships and Includes
- Filtering
- Sorting, Pagination, and Sparse Fieldsets
- Content Types and Errors
- Bulk Requests
- RPC / Custom Methods
- Customization
- Security and Access Control
- Stateless Endpoints / JABase
- Performance
- Examples
- Existing Databases (Legacy)
- PostGIS / GeoAlchemy2
- Docker / Deployment
- Troubleshooting
- Reference: SAFRSBase
- Reference: SAFRSBase Customization