-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Revisit Jackson support #33798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
Comments
6 tasks
See the related blog post https://cowtowncoder.medium.com/taking-jackson-3-0-0-rc1-for-a-spin-17282161a6b2. |
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
May 13, 2025
This commit adds Jackson 3 BOM to Spring Framework platform dependencies and related Javadoc link. See spring-projectsgh-33798
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
May 13, 2025
This commit introduces Jackson 3 variants of the following Jackson 2 classes (and related dependent classes). org.springframework.http.codec.json.Jackson2CodecSupport -> org.springframework.http.codec.JacksonCodecSupport org.springframework.http.codec.json.Jackson2Tokenizer -> org.springframework.http.codec.JacksonTokenizer org.springframework.http.codec.json.Jackson2SmileDecoder -> org.springframework.http.codec.smile.JacksonSmileDecoder org.springframework.http.codec.json.Jackson2SmileEncoder -> org.springframework.http.codec.smile.JacksonSmileEncoder Jackson2CborDecoder -> JacksonCborDecoder Jackson2CborEncoder -> JacksonCborEncoder Jackson2JsonDecoder -> JacksonJsonDecoder Jackson2JsonEncoder -> JacksonJsonEncoder Jackson 3 support is configured if found in the classpath otherwise fallback to Jackson 2. See spring-projectsgh-33798
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
May 13, 2025
This commit introduces a org.springframework.http.support.JacksonHandlerInstantiator Jackson 3 variant of org.springframework.http.converter.json.SpringHandlerInstantiator Jackson 2 class. See spring-projectsgh-33798
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
May 13, 2025
This commit introduces Jackson 3 GenericHttpMessageConverter based variants of the following Jackson 2 classes (and related dependent classes). org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter -> org.springframework.http.converter.AbstractJacksonHttpMessageConverter MappingJackson2HttpMessageConverter -> JacksonJsonHttpMessageConverter MappingJackson2SmileHttpMessageConverter -> JacksonSmileHttpMessageConverter MappingJackson2CborHttpMessageConverter -> JacksonCborHttpMessageConverter MappingJackson2XmlHttpMessageConverter -> JacksonXmlHttpMessageConverter MappingJackson2YamlHttpMessageConverter -> JacksonYamlHttpMessageConverter They use hints instead of MappingJacksonValue and MappingJacksonInputMessage to support `@JsonView` and FilterProvider. Jackson 3 support is configured if found in the classpath otherwise fallback to Jackson 2. See spring-projectsgh-33798
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
May 13, 2025
This commit introduces Jackson 3 based variants of the following Jackson 2 classes (and related dependent classes). MappingJackson2JsonView -> JacksonJsonView MappingJackson2XmlView-> JacksonXmlView See spring-projectsgh-33798
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
May 13, 2025
This commit introduces RequestBodyAdvice#determineReadHints and ResponseBodyAdvice#determineWriteHints in order to be able to support SmartHttpMessageConverter hints, as well as related `@JsonView` support. See spring-projectsgh-33798
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
May 13, 2025
This commit introduces a JacksonJsonMessageConverter Jackson 3 variant of MappingJackson2MessageConverter. See spring-projectsgh-33798
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
May 13, 2025
This commit introduces a JacksonJsonMessageConverter Jackson 3 variant of MappingJackson2MessageConverter. See spring-projectsgh-33798
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
May 13, 2025
This commit introduces a JacksonJsonSockJsMessageCodec Jackson 3 variant of Jackson2SockJsMessageCodec. See spring-projectsgh-33798
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
May 13, 2025
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
May 13, 2025
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
May 13, 2025
This commit adds Jackson 3 BOM to Spring Framework platform dependencies and related Javadoc link. See spring-projectsgh-33798
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
May 13, 2025
This commit introduces Jackson 3 variants of the following Jackson 2 classes (and related dependent classes). org.springframework.http.codec.json.Jackson2CodecSupport -> org.springframework.http.codec.JacksonCodecSupport org.springframework.http.codec.json.Jackson2Tokenizer -> org.springframework.http.codec.JacksonTokenizer org.springframework.http.codec.json.Jackson2SmileDecoder -> org.springframework.http.codec.smile.JacksonSmileDecoder org.springframework.http.codec.json.Jackson2SmileEncoder -> org.springframework.http.codec.smile.JacksonSmileEncoder Jackson2CborDecoder -> JacksonCborDecoder Jackson2CborEncoder -> JacksonCborEncoder Jackson2JsonDecoder -> JacksonJsonDecoder Jackson2JsonEncoder -> JacksonJsonEncoder Jackson 3 support is configured if found in the classpath otherwise fallback to Jackson 2. See spring-projectsgh-33798
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
May 13, 2025
This commit introduces a org.springframework.http.support.JacksonHandlerInstantiator Jackson 3 variant of org.springframework.http.converter.json.SpringHandlerInstantiator Jackson 2 class. See spring-projectsgh-33798
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
May 13, 2025
This commit introduces Jackson 3 SmartHttpMessageConverter based variants of the following Jackson 2 classes (and related dependent classes). org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter -> org.springframework.http.converter.AbstractJacksonHttpMessageConverter MappingJackson2HttpMessageConverter -> JacksonJsonHttpMessageConverter MappingJackson2SmileHttpMessageConverter -> JacksonSmileHttpMessageConverter MappingJackson2CborHttpMessageConverter -> JacksonCborHttpMessageConverter MappingJackson2XmlHttpMessageConverter -> JacksonXmlHttpMessageConverter MappingJackson2YamlHttpMessageConverter -> JacksonYamlHttpMessageConverter They use hints instead of MappingJacksonValue and MappingJacksonInputMessage to support `@JsonView` and FilterProvider. Jackson 3 support is configured if found in the classpath otherwise fallback to Jackson 2. JacksonHandlerInstantiator needs to be enabled explicitly if needed. See spring-projectsgh-33798
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
May 13, 2025
This commit introduces Jackson 3 based variants of the following Jackson 2 classes (and related dependent classes). MappingJackson2JsonView -> JacksonJsonView MappingJackson2XmlView-> JacksonXmlView See spring-projectsgh-33798
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
May 13, 2025
This commit introduces RequestBodyAdvice#determineReadHints and ResponseBodyAdvice#determineWriteHints in order to be able to support SmartHttpMessageConverter hints, as well as related `@JsonView` support. See spring-projectsgh-33798
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
May 13, 2025
This commit introduces a JacksonJsonMessageConverter Jackson 3 variant of MappingJackson2MessageConverter. See spring-projectsgh-33798
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
May 13, 2025
This commit introduces a JacksonJsonMessageConverter Jackson 3 variant of MappingJackson2MessageConverter. See spring-projectsgh-33798
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
May 13, 2025
This commit introduces a JacksonJsonSockJsMessageCodec Jackson 3 variant of Jackson2SockJsMessageCodec. See spring-projectsgh-33798
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
May 13, 2025
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
May 13, 2025
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
May 13, 2025
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
May 13, 2025
This commit deprecate for removal (likely in a future 7.x release) the Jackson 2 support in favor of the Jackson 3 one. Closes spring-projectsgh-33798
This was referenced May 19, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Uh oh!
There was an error while loading. Please reload this page.
Spring Framework 7.0 introduces Jackson 3 support in parallel of the now deprecated Jackson 2 one.
More information can be found on the changes of migrating from Jackson 2 to Jackson 3 in the following links:
The Jackson 3 changes with the biggest impact on Spring use-cases are:
tools.jackson
) than Jackson 2 (com.fasterxml.jackson
) except for jackson-annotation (@JsonView
,@JsonTypeInfo
) which keeps usingcom.fasterxml.jackson
ObjectMapper#canDeserialize
andObjectMapper#canSerialize
have been removed as they were not reliable, so Jackson 3 converters and codecs only test mime types and type resolution in their canXxx methods.MapperFeature.SORT_PROPERTIES_ALPHABETICALLY
)JsonWriteFeature.ESCAPE_FORWARD_SLASHES
, impactProblemDetail
)MapperFeature.DEFAULT_VIEW_INCLUSION
is disabled by defaultDeserializationFeature.FAIL_ON_UNEXPECTED_VIEW_PROPERTIES
is disabled by defaultGeneral:
Jackson2ObjectMapperBuilder
is provided, the recommendation is to useJsonMapper.builder()
,CBORMapper.builder()
, etc.MapperBuilder#findModules(java.lang.ClassLoader)
are registered in converters and codecsorg.springframework.http.converter.json.SpringHandlerInstantiator
enabled by default in Spring MVC ->org.springframework.http.support.JacksonHandlerInstantiator
now requires explicit configurationWebMVC:
GenericHttpMessageConverter
toSmartHttpMessageConverter
which support hintsMappingJacksonValue
andMappingJacksonInputMessage
to support@JsonView
andFilterProvider
RequestBodyAdvice#determineReadHints
andResponseBodyAdvice#determineWriteHints
JsonViewRequestBodyAdvice
andJsonViewResponseBodyAdvice
supports both Jackson 2 (with wrappers) and Jackson 3 (with hints)org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter
->org.springframework.http.converter.AbstractJacksonHttpMessageConverter
MappingJackson2HttpMessageConverter
->JacksonJsonHttpMessageConverter
MappingJackson2SmileHttpMessageConverter
->JacksonSmileHttpMessageConverter
MappingJackson2CborHttpMessageConverter
->JacksonCborHttpMessageConverter
MappingJackson2XmlHttpMessageConverter
->JacksonXmlHttpMessageConverter
MappingJackson2YamlHttpMessageConverter
->JacksonYamlHttpMessageConverter
MappingJackson2JsonView
->JacksonJsonView
MappingJackson2XmlView
->JacksonXmlView
WebFlux:
org.springframework.http.codec.json.Jackson2CodecSupport
->org.springframework.http.codec.JacksonCodecSupport
org.springframework.http.codec.json.Jackson2Tokenizer
->org.springframework.http.codec.JacksonTokenizer
org.springframework.http.codec.json.Jackson2SmileDecoder
->org.springframework.http.codec.smile.JacksonSmileDecoder
org.springframework.http.codec.json.Jackson2SmileEncoder
->org.springframework.http.codec.smile.JacksonSmileEncoder
Jackson2CborDecoder
->JacksonCborDecoder
Jackson2CborEncoder
->JacksonCborEncoder
Jackson2JsonDecoder
->JacksonJsonDecoder
Jackson2JsonEncoder
->JacksonJsonEncoder
Messaging:
MappingJackson2MessageConverter
->JacksonJsonMessageConverter
JMS:
MappingJackson2MessageConverter
->JacksonJsonMessageConverter
TODO:
@JacksonXmlRootElement
is ignored with Jackson 3 FasterXML/jackson-dataformat-xml#757RestClient
to support@JsonView
andFilterProvider
(no support inRestTemplate
, migration path will be to switch toRestClient
)The text was updated successfully, but these errors were encountered: