Closed robertvazan closed 9 months ago
Now standard Jackson binary format backends contains avro, cbor, protobuf and smile,the JacksonConverterFactory
can switch to binary format when the ObjectMapper
support binary format data.please make a pull request.
Eclipse didn't like the project for some reason. I don't have time to investigate it right now. Anyone with working build/tests should have easy time implementing this.
In JacksonResponseBodyConverter, replace value.charStream()
with value.byteStream()
.
In JacksonRequestBodyConverter, turn MEDIA_TYPE
into configurable parameter (passed from JacksonConverterFactory).
And perhaps add a test case in JacksonConverterFactoryTest.
I am using CBOR for request/response encoding. I am creating Jackson
ObjectMapper
withCBORFactory
like this:I then tried to use the existing
JacksonConverterFactory
like this:But this failed with an exception, because
JacksonConverterFactory
insists on reading/writing documents as text while CBOR requires binary I/O.I have implemented custom converter as a workaround. It would be nice to have CBOR supported simply by passing in custom
ObjectMapper
. Switching to binary I/O should have no negative impact on JSON serialization AFAIK.