lightblue-platform / lightblue-client

GNU General Public License v3.0
5 stars 24 forks source link

Injected ObjectMapper not actually used for request serialization #328

Open alechenninger opened 7 years ago

alechenninger commented 7 years ago

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.