Add Smile and CBOR Jackson data formats support

This commit adds Smile and CBOR Jackson HttpMessageConverters
and make it possible to create Smile and CBOR ObjectMapper via
Jackson2ObjectMapperBuilder, which now allows to specify any
custom JsonFactory.

Like with JSON and XML Jackson support, the relevant
HttpMessageConverters are automaticially configurered by
Spring MVC WebMvcConfigurationSupport if jackson-dataformat-smile
or jackson-dataformat-cbor dependencies are found in the classpath.

Issue: SPR-14435
This commit is contained in:
Sebastien Deleuze
2016-08-30 11:06:40 +02:00
parent c399b4b3ad
commit e8530c917e
14 changed files with 487 additions and 2 deletions

View File

@@ -175,7 +175,7 @@ public class WebMvcConfigurationSupportTests {
ApplicationContext context = initContext(WebConfig.class);
RequestMappingHandlerAdapter adapter = context.getBean(RequestMappingHandlerAdapter.class);
List<HttpMessageConverter<?>> converters = adapter.getMessageConverters();
assertEquals(9, converters.size());
assertEquals(11, converters.size());
converters.stream()
.filter(converter -> converter instanceof AbstractJackson2HttpMessageConverter)
.forEach(converter -> {