qbit
qbit copied to clipboard
Plugin a different JSON Mapper (Both request and response)
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.
You can replace the factory. I will try to come up with an example swapping in Jackson instead of Boon.