Restore Jackson XML participation in WebFlux codecs#36828
Open
Noah3521 wants to merge 1 commit into
Open
Conversation
Register Jackson XML after JAXB so WebFlux keeps JAXB-first behavior while allowing Jackson XML when JAXB is also present. Keep raw String values on the String codec path by applying XML-level Jackson String guards. Closes spring-projectsgh-36776 Closes spring-projectsgh-36775 Constraint: Avoid MVC parity claims; keep WebFlux JAXB first. Rejected: Jackson-first XML registration | changes JAXB behavior. Confidence: high Scope-risk: moderate Directive: Keep XML codec ordering tests explicit. Tested: Targeted spring-web codec/configurer test suite. Tested: ./gradlew :spring-web:check --no-configuration-cache Not-tested: Full repository check. Signed-off-by: noah3521 <noah3521@icloud.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR updates WebFlux default XML codec registration so Jackson XML codecs are available when present even if JAXB is also on the classpath.
The ordering intentionally keeps JAXB XML codecs before Jackson XML codecs to preserve existing WebFlux behavior for JAXB-eligible types while restoring Jackson XML availability for supported cases that JAXB does not cover.
It also applies XML-level Jackson String checks for both encoder and decoder, matching the JSON codec-level checks moved in gh-35872, so raw String values remain on String codec paths.
Closes gh-36776
Closes gh-36775
Verification
git diff --check./gradlew :spring-web:test --tests 'org.springframework.http.codec.support.CodecConfigurerTests' --tests 'org.springframework.http.codec.support.ClientCodecConfigurerTests' --tests 'org.springframework.http.codec.support.ServerCodecConfigurerTests' --tests 'org.springframework.http.codec.xml.JacksonXmlEncoderTests' --tests 'org.springframework.http.codec.xml.JacksonXmlDecoderTests' --configuration-cache./gradlew :spring-web:check --no-configuration-cache