qbit icon indicating copy to clipboard operation
qbit copied to clipboard

Plugin a different JSON Mapper (Both request and response)

Open dmcocca opened this issue 9 years ago • 1 comments

It appears I can override the default JSON parser by calling "setJsonMapper" on ServiceEndpoint. I do not see a way to swap-out the default mapper for requests. StandardRequestTransformer uses the default mapper:

private final Factory factory = QBit.factory();
protected final ThreadLocal<JsonMapper> jsonMapper = new ThreadLocal<JsonMapper>() {
        @Override
        protected JsonMapper initialValue() {
            return factory.createJsonMapper();
        }
    };

Perhaps I'm missing something, but I could not find a clean way of plugging in a different mapper.

dmcocca avatar Feb 26 '16 18:02 dmcocca

You can replace the factory. I will try to come up with an example swapping in Jackson instead of Boon.

RichardHightower avatar Mar 18 '16 17:03 RichardHightower