Skip to content

test(#758): cover @JsonIgnoreProperties(ignoreUnknown) across bundles - #759

Open
jbonofre wants to merge 1 commit into
apache:mainfrom
jbonofre:test/758-jackson-ignore-unknown
Open

jbonofre wants to merge 1 commit into
apache:mainfrom
jbonofre:test/758-jackson-ignore-unknown

Conversation

@jbonofre

@jbonofre jbonofre commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Refs #758 (does not close it: the issue is not reproduced yet).

Summary

Extends the camel-jackson Pax Exam test so that the Jackson unmarshal runs against an entity that:

  • is annotated with @JsonIgnoreProperties(ignoreUnknown = true), and
  • lives in its own bundle, separate from jackson-databind.

The input JSON carries a property the entity does not declare. If Jackson stops honouring the annotation across the bundle boundary, the unmarshal fails and the mock endpoint receives nothing, so the test fails.

Investigation

  • The camel-jackson bundle's Jackson Import-Package ranges are identical in 4.18.2 and 4.18.4.
  • The jackson feature only moves databind and core from 2.21.2 to 2.21.4; jackson-annotations is unchanged.
  • The only upstream Camel change is CAMEL-23786 (JsonMapper with BLOCK_UNSAFE_POLYMORPHIC_BASE_TYPES), which does not affect unknown-property handling. A plain-Java check on Jackson 2.21.4 confirmed this.
  • This test passes on the current tree (4.22.1-SNAPSHOT) and fails when the annotation is removed, so it can detect the problem. It was not run against the 4.18.4 tag.

The reporter's environment (duplicate or stale jackson-annotations bundles) remains the most likely cause.

Test plan

  • mvn -o verify -pl tests/features/camel-jackson passes
  • Same run fails (Expected: <1> but was: <0>) with the annotation removed

AI-assisted, on behalf of JB Onofré.

…ntity in a separate bundle

The camel-jackson Pax Exam test now unmarshals JSON carrying a property the entity does not declare, into an entity annotated with ignoreUnknown that lives in its own bundle. It fails if the annotation is not honoured across the bundle boundary.
@jbonofre
jbonofre requested review from gnodet and oscerd October 6, 2026 09:01
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.

1 participant