Uh oh!
There was an error while loading. Please reload this page.
Support configuring the Jackson Object Mapper - #376
Conversation
coveralls
commented
Jul 21, 2017
decebals
commented
Jul 21, 2017
Thanks! I will take a look. |
decebals
commented
Jul 21, 2017
In the end, I don't see the the difference. You replaced |
| objectMapper.registerModule(new AfterburnerModule()); | ||
| } | ||
| protected abstract ObjectMapper getObjectMapper(); |
There was a problem hiding this comment.
It's enough to make this method public.
lorrin
commented
Jul 21, 2017
Hi, I hadn't looked at #274 before submitting this. I agree It is not enough to make I think the #274 pattern is probably cleanest, even though a bit more verbose. I propose the following:
What would be different is that when I create my own ObjectMapper, I would just extend |
lorrin
commented
Jul 21, 2017
Never mind, I hadn't fully understood the #274 pattern until I tried it. You're right, the changes I submitted weren't needed to customize Jackson easily. I've kept this PR alive as a simple rename from |
coveralls
commented
Jul 21, 2017
decebals
commented
Jul 22, 2017
The rename is good but we have a problem because we brake the API, without a very good reason and I am sure that they are people that use this method ( |
lorrin
commented
Jul 31, 2017
Alright, I'll close this then. Thanks for your help. |
lorrin
commented
Aug 2, 2017
BTW, if anyone stumbles across this looking for info on how to follow the #274 pattern, it's like this: JacksonJsonEnginecustomEngine = newJacksonJsonEngine(){
@Overridepublicvoidinit(Applicationapplication) {
super.init(application);
objectMapper.registerModule(newJdk8Module());
objectMapper.registerModule(newGuavaModule());
}
};
customEngine.init(this);
getContentTypeEngines().setContentTypeEngine(customEngine); |
This change provides a getter for the Jackson Object Mapper so that Pippo applications can customize it as they need. E.g. I have this in my
onInit: