CustomiseInterceptors
Allows customising the interceptors used by the server interpreter. Custom interceptors should usually be added using addInterceptor
. That way, the custom interceptor is called after the built-in ones (such as logging, metrics, exceptions), and before the decode failure handler. For even more flexibility, interceptors can be added to the beginning or end of the interceptor stack, using prependInterceptor
and appendInterceptor
.
The first interceptor in the interceptor stack is the one which is called first on request, and processes the resulting response as the last one.
Built-in interceptors can be customised or disabled using the dedicated methods.
Once done, use options to obtain the server interpreter options objects, which can be passed to the server interpreter.
Value parameters
- additionalInterceptors
-
Additional interceptors, which will be called before (on request) / after (on response) the
decodeFailureHandler
one, e.g. performing logging, metrics, or providing alternate responses. - appendedInterceptors
-
Additional interceptors, which will be called last on request / first on response, e.g. handling decode failures, or providing alternate responses.
- decodeFailureHandler
-
The decode failure handler, from which an interceptor will be created. Determines whether to respond when an input fails to decode.
- exceptionHandler
-
Whether to respond to exceptions in the server logic, or propagate them to the server.
- metricsInterceptor
-
Whether to collect metrics.
- notAcceptableInterceptor
-
Whether to return 406 (not acceptable) if there's no body in the endpoint's outputs, which can satisfy the constraints from the
Accept
header. - prependedInterceptors
-
Additional interceptors, which will be called first on request / last on response, e.g. performing logging, metrics, or providing alternate responses.
- rejectHandler
-
How to respond when decoding fails for all interpreted endpoints.
- serverLog
-
The server log using which an interceptor will be created, if any.
Attributes
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any