Marker trait denoting the default MessageBodyReader for the HTTP server.
A marker trait denoting the default MessageBodyWriter for the HTTP server.
A marker trait denoting the default MessageBodyWriter for the HTTP server. This default MessageBodyWriter is invoked by either the com.twitter.finatra.http.internal.marshalling.CallbackConverter (by invoking the com.twitter.finatra.http.response.ResponseBuilder) or com.twitter.finatra.http.response.ResponseBuilder#write directly to return a suitable response for a given return type.
The framework binds com.twitter.finatra.http.internal.marshalling.DefaultMessageBodyWriterImpl as an overridable implementation via the com.twitter.finatra.http.modules.MessageBodyModule. To override this implementation, provide a customized com.twitter.inject.TwitterModule by overriding com.twitter.finatra.http.HttpServer.messageBodyModule, e.g.,
class MyServer extends HttpServer { ... override val messageBodyModule = MyCustomMessageBodyModule }
The framework default MessageBodyWriter will attempt to convert the outgoing type T
to a JSON
response using the server's configured com.twitter.finatra.json.FinatraObjectMapper.
https://twitter.github.io/finatra/user-guide/json/routing.html#responses
com.twitter.finatra.http.internal.marshalling.MessageBodyManager
com.twitter.finatra.http.internal.marshalling.DefaultMessageBodyWriterImpl
Marker trait for MessageBodyReaders and MessageBodyWriters
MessageBodyReader transforms an HTTP Request into an object.
MessageBodyWriter transforms an object into an HTTP Response.
Marker trait denoting the default MessageBodyReader for the HTTP server. This default MessageBodyReader is invoked when the com.twitter.finatra.http.internal.marshalling.CallbackConverter cannot find a suitable MessageBodyReader to convert the incoming Finagle request into the route callback input type. E.g., given a defined route in a Controller:
The com.twitter.finatra.http.internal.marshalling.CallbackConverter attempts to locate a com.twitter.finatra.http.internal.marshalling.MessageBodyManager which can parse a Finagle request into the input type
T
. If one is not found, this default is invoked.The framework binds com.twitter.finatra.http.internal.marshalling.DefaultMessageBodyReaderImpl as an overridable implementation via the com.twitter.finatra.http.modules.MessageBodyModule.
To override this implementation, provide a customized com.twitter.inject.TwitterModule by overriding com.twitter.finatra.http.HttpServer.messageBodyModule, e.g.,
The framework default MessageBodyReader will attempt to convert the incoming request body using the server's configured com.twitter.finatra.json.FinatraObjectMapper and is the basis for the framework's JSON Integration with Routing.
The DefaultMessageBodyReader trait differs from the MessageBodyReader trait in that the default is not parameterized to a specific type but instead defines a generic
parse[T]
function which can generate a type T from a given request. A MessageBodyReader is expected to only ever generate a single typeT
from it'sparse[T]
implementation.https://twitter.github.io/finatra/user-guide/json/routing.html#requests
com.twitter.finatra.http.HttpServer.messageBodyModule
com.twitter.finatra.http.modules.MessageBodyModule
com.twitter.finatra.http.internal.marshalling.MessageBodyManager
com.twitter.finatra.http.internal.marshalling.DefaultMessageBodyReaderImpl