Skip to content

[JavaJaxRS] [CXF] Add Support for Jackson3 fixes #23616#23719

Open
fwermelskirchen wants to merge 5 commits intoOpenAPITools:masterfrom
fwermelskirchen:master
Open

[JavaJaxRS] [CXF] Add Support for Jackson3 fixes #23616#23719
fwermelskirchen wants to merge 5 commits intoOpenAPITools:masterfrom
fwermelskirchen:master

Conversation

@fwermelskirchen
Copy link
Copy Markdown
Contributor

@fwermelskirchen fwermelskirchen commented May 8, 2026

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in WSL)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • File the PR against the correct branch: master (upcoming 7.x.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR solves a reported issue, reference it using GitHub's linking syntax (e.g., having "fixes #123" present in the PR description)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

Summary by cubic

Adds Jackson 3 support to the Java JAX-RS CXF client generator via a new useJackson3 option. When enabled, it uses tools.jackson packages, the Jakarta RS provider, CXF 4.2.0, and Java 11; Jackson 2 with Java 8 remains the default.

  • New Features

    • Added useJackson3; sets jacksonPackage to tools.jackson (v3) or com.fasterxml.jackson (v2).
    • POM and imports use {{jacksonPackage}}; selects jackson-jaxrs 3.1.2 + CXF 4.2.0 for v3, else 2.17.1 + CXF 3.5.9.
    • Provider imports: v3 uses ...jakarta.rs...; v2 uses ...jakarta.rs... only when useJakartaEe is true, otherwise com.fasterxml.jackson.jaxrs.
    • Java 11 for v3, Java 8 for v2; skip jackson-datatype-jsr310 when useJackson3.
  • Migration

    • Set additionalProperties useJackson3: "true" (and useJakartaEe: "true").
    • Requires Java 11 when using Jackson 3.
    • For Java Time with Jackson 3, add the module explicitly in your project.

Written for commit d4876fc. Summary will update on new commits.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 14 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="samples/client/petstore/jaxrs-cxf-client-jackson/pom.xml">

<violation number="1" location="samples/client/petstore/jaxrs-cxf-client-jackson/pom.xml:196">
P1: Upgrading to CXF 4.2.0/Jackson 3.1.2 while keeping the project at Java 8 creates an unsupported JDK baseline mismatch.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread samples/client/petstore/jaxrs-cxf-client-jackson/pom.xml
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 3 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache">

<violation number="1" location="modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache:253">
P0: Missing opening '<' in XML element for java.version property in default (useJackson3=false) branch will produce malformed POM</violation>
</file>

<file name="samples/client/petstore/jaxrs-cxf-client-jackson/.openapi-generator/VERSION">

<violation number="1" location="samples/client/petstore/jaxrs-cxf-client-jackson/.openapi-generator/VERSION:1">
P3: Generated sample metadata was downgraded to an older generator snapshot, making the sample inconsistent with the repo's current version.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache Outdated
@@ -1 +1 @@
7.23.0-SNAPSHOT
7.22.0-SNAPSHOT
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Generated sample metadata was downgraded to an older generator snapshot, making the sample inconsistent with the repo's current version.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/jaxrs-cxf-client-jackson/.openapi-generator/VERSION, line 1:

<comment>Generated sample metadata was downgraded to an older generator snapshot, making the sample inconsistent with the repo's current version.</comment>

<file context>
@@ -1 +1 @@
-7.23.0-SNAPSHOT
+7.22.0-SNAPSHOT
</file context>
Suggested change
7.22.0-SNAPSHOT
+7.23.0-SNAPSHOT

@wing328
Copy link
Copy Markdown
Member

wing328 commented May 9, 2026

thanks for the PR. please follow step 3 to update the samples

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.

2 participants