Skip to content

Preserve QName prefix in JacksonExecutionContextStringSerializer - #5529

Open
jjh75607 wants to merge 1 commit into
spring-projects:mainfrom
jjh75607:fix/qname-prefix-jackson3-serializer
Open

jjh75607 wants to merge 1 commit into
spring-projects:mainfrom
jjh75607:fix/qname-prefix-jackson3-serializer

Conversation

@jjh75607

@jjh75607 jjh75607 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

QNameSerializer defaults to a string shape, so JacksonExecutionContextStringSerializer writes a QName as {namespaceURI}localPart and reads it back with an empty prefix. Nothing throws, so the loss stays invisible until a restarted run closes <batch:element> with </element>.

Enabling the object shape that FasterXML/jackson-databind#4771 added is enough. Two of the three tests added here fail on main with expected: <batch> but was: <>; the third is a guard on the previous format.

Stored data is compatible in both directions. Old rows still read, and rows written after this change stay readable by the previous configuration with the prefix intact, so a revert does not strand them. An empty namespace URI still loses the prefix, since the serializer omits that field and the deserializer then ignores prefix. That part is upstream.

This does not close #4697, which is about Jackson2ExecutionContextStringSerializer. That one needs FasterXML/jackson-databind#6175 ported to 2.x first. 6.0.x carries the same constructor if you want a backport.

Signed-off-by: jjh75607 <jjh7560734@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jackson2ExecutionContextStringSerializer ignores QName prefix

1 participant