Skip to content

HTTP Method Decorators

Thomas Pollet edited this page Mar 8, 2026 · 3 revisions

Endpoint Decorators

What decorators are for

Decorators let you add cross-cutting behavior to SAFRS endpoints, for example:

  • authentication
  • authorization
  • logging
  • request shaping

Model-level decorators

Flask SAFRS can use model-level decorator lists such as:

  • decorators
  • custom_decorators

These are commonly used in the authentication examples.

Relationship-level decorators

Relationship routes can also have their own decorator and method controls.

FastAPI note

The FastAPI adapter does not implement Flask method_decorators. Use FastAPI-native dependencies and middleware instead.

Examples

Clone this wiki locally