Interceptors
Docs Home | Previous: Guards and Security | Next: Middleware
Interceptors wrap controller execution and can transform responses or return early.
Common Uses
- response envelopes
- timing and metrics
- cache short-circuiting
- output normalization
Typical Shape
Registering Interceptors
- Global: createApp({ interceptors: [...] })
- Controller: @UseInterceptors(...)
- Method: @UseInterceptors(...)
Short-Circuit Pattern
An interceptor may return a Response directly to stop downstream execution.
Response Validation Interaction
If validateResponse is enabled, transformed output still needs to match the declared @Returns schema for the final status code.