resthub / resthub-spring-stack

RESThub Spring stack
http://resthub.org/spring-stack.html
Other
121 stars 66 forks source link

Add extension point to provide custom jackson ObjectMapper modules #238

Closed bmeurant closed 10 years ago

bmeurant commented 10 years ago

Today, there is no simple way to "inject" custom Serialization module into Jackson ObjectMapper in Resthub.

If we want to provide a custom module to globally serialize owned or third-party object in a Resthub base application, we have to work with BeanPostProcessors.

It could be interesting to allow addition of custom modules through Resthub & Jackson configuration

bclozel commented 10 years ago

Maybe this? https://jira.springsource.org/browse/SPR-11040

bmeurant commented 10 years ago

It sounds good ... I will test soon ! thx for the pointer !

jripault commented 10 years ago

Would be nice to have this declaration

<bean class="org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean">
   <property name="modulesToInstall" ref="resthubModules"/>
 </bean>

resthubModules being the list of Jackson modules to add for Resthub. and having a sublist, added to resthubModules for custom modules (same MO as jpaProperties)

bclozel commented 10 years ago

Also, in Boot - any ObjectMapper bean is automatically registered; see: HttpMessageConvertersAutoConfiguration.