Request serialization relies on getBody() implementation of request objects, and these delegate to the default object mapper.
So the only way to configure the object mapper used is to mutate the global default or set a new global default via the JSON class.
It looks like this is not a problem with responses.
Architecturally, requests are not created via the client (using it as a factory), but instead they're are newed up independently in client code, which means it's up to clients to inject the right ObjectMapper, and currently it's not injectable at all. One way would be to avoid the String getBody() method on requests, which implies a need for serialization, which implies a need to be able to customize serialization, and instead work exclusively from the JsonNode getBodyJson() method.
Request serialization relies on getBody() implementation of request objects, and these delegate to the default object mapper.
So the only way to configure the object mapper used is to mutate the global default or set a new global default via the JSON class.
It looks like this is not a problem with responses.
Architecturally, requests are not created via the client (using it as a factory), but instead they're are newed up independently in client code, which means it's up to clients to inject the right ObjectMapper, and currently it's not injectable at all. One way would be to avoid the
String getBody()
method on requests, which implies a need for serialization, which implies a need to be able to customize serialization, and instead work exclusively from theJsonNode getBodyJson()
method.