Allow Jackson's serialization inclusion to be configured via the env

This commit adds support for configuring an ObjectMapper's
serialization inclusion using the environment via the
spring.jackson.serialization-inclusion property. The property's value
should be one of the values on the JsonInclude.Include enumeration.
Relaxed binding of the property value to the enum is supported. For
example:

spring.jackson.serialization-inclusion: non_null

Closes gh-2532
This commit is contained in:
Andy Wilkinson
2015-04-08 16:47:49 +01:00
parent 60734548fe
commit 1dcf18b16e
4 changed files with 44 additions and 2 deletions

View File

@@ -142,6 +142,7 @@ content into your application; rather pick only the properties that you need.
spring.jackson.mapper.*= # see Jackson's MapperFeature
spring.jackson.parser.*= # see Jackson's JsonParser.Feature
spring.jackson.serialization.*= # see Jackson's SerializationFeature
spring.jackson.serialization-inclusion= # Controls the inclusion of properties during serialization (see Jackson's JsonInclude.Include)
# THYMELEAF ({sc-spring-boot-autoconfigure}/thymeleaf/ThymeleafAutoConfiguration.{sc-ext}[ThymeleafAutoConfiguration])
spring.thymeleaf.check-template-location=true