-
Notifications
You must be signed in to change notification settings - Fork 73
HTTP Method Decorators
Thomas Pollet edited this page Mar 8, 2026
·
3 revisions
- Applies to: Flask primarily; FastAPI uses dependencies and middleware patterns instead
- Best examples:
examples/authentication/demo_auth.py,examples/authentication/demo_post_auth.py - Related pages: Security and Access Control, HTTP Methods and Hooks
Decorators let you add cross-cutting behavior to SAFRS endpoints, for example:
- authentication
- authorization
- logging
- request shaping
Flask SAFRS can use model-level decorator lists such as:
decoratorscustom_decorators
These are commonly used in the authentication examples.
Relationship routes can also have their own decorator and method controls.
The FastAPI adapter does not implement Flask method_decorators. Use FastAPI-native dependencies and middleware instead.
- 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