DefaultDecodeFailureHandler

sttp.tapir.server.interceptor.decodefailure.DefaultDecodeFailureHandler
See theDefaultDecodeFailureHandler companion object
case class DefaultDecodeFailureHandler(respond: DecodeFailureContext => Option[(StatusCode, List[Header])], failureMessage: DecodeFailureContext => String, response: (StatusCode, List[Header], String) => ValuedEndpointOutput[_]) extends DecodeFailureHandler

A decode failure handler, which:

  • decides whether the given decode failure should lead to a response (and if so, with which status code and headers), using respond
  • in case a response is sent, creates the message using failureMessage
  • in case a response is sent, creates the response using response, given the status code, headers, and the created failure message. By default, the headers might include authentication challenge.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

Given the context in which a decode failure occurred (the request, the input and the failure), returns an optional response to the request. None indicates that no action should be taken, and the request might be passed for decoding to other endpoints.

Given the context in which a decode failure occurred (the request, the input and the failure), returns an optional response to the request. None indicates that no action should be taken, and the request might be passed for decoding to other endpoints.

Inputs are decoded in the following order: path, method, query, headers, body. Hence, if there's a decode failure on a query parameter, any method & path inputs of the input must have matched and must have been decoded successfully.

Attributes

def response(messageOutput: String => ValuedEndpointOutput[_]): DefaultDecodeFailureHandler

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product