You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JacksonXmlEncoder.canEncode incorrectly returns true for String body with application/xml #36775
JacksonXmlEncoder does not override canEncode, so it incorrectly signals support for String bodies.
Expected Behavior
JacksonXmlEncoder.canEncode should return false for String types, similar to JacksonJsonEncoder. And falls back to a non-streaming encoder for String bodies with application/xml.
This looks like a regression after #35872 and c10266e, which moved String checks to the JSON codec level from AbastractJacksonEncoder and AbstractJacksonDecoder as those do not make sense for binary formats. The same change should be applied to the XML codec level.
Activity
rstoyanchev commentedon May 21, 2026
This looks like a regression after #35872 and c10266e, which moved String checks to the JSON codec level from
AbastractJacksonEncoderandAbstractJacksonDecoderas those do not make sense for binary formats. The same change should be applied to the XML codec level.sdeleuze commentedon Jun 1, 2026
+1 to what @rstoyanchev said.
Exclude Jackson XML from String encoding/decoding