Skip to content

[jaxrs-spec] add useJackson3 option - #25406

Open
Zouinek wants to merge 7 commits into
OpenAPITools:masterfrom
Zouinek:jaxrs-spec-jackson3
Open

Zouinek wants to merge 7 commits into
OpenAPITools:masterfrom
Zouinek:jaxrs-spec-jackson3

Conversation

@Zouinek

@Zouinek Zouinek commented Oct 25, 2026 •

Copy link
Copy Markdown

Fixes #25363

Adds a useJackson3 option to the jaxrs-spec generator. Jackson 2 stays the default.

  • useJackson3 option + cliOption, jacksonPackage property, JsonDeserialize import mapping (moved to tools.jackson.databind in Jackson 3)
  • spec/pom.mustache: {{jacksonPackage}} groupIds for the JAX-RS providers, jackson-datatype-jsr310 only for Jackson 2 (built into databind in Jackson 3), Jackson 3 version 3.1.2 (aligned with the CXF generator)
  • pojo.mustache: Shape.POJO instead of Shape.OBJECT for Jackson 3 when additional properties are used
  • Test testUseJackson3 in JavaJAXRSSpecServerCodegenTest
  • Docs regenerated. jaxrs-spec samples regenerated: no changes, since Jackson 2 output is identical.

openliberty/pom.mustache unchanged: it only depends on jackson-annotations, which keeps the com.fasterxml.jackson.core groupId in Jackson 3.

Notes / possible follow-ups:

  • USE_JACKSON_3 and the Jackson package constants are now duplicated across several generators. Happy to consolidate them into AbstractJavaCodegen in a follow-up PR.
  • 3.1.8 is the latest Jackson 3.1.x; I kept 3.1.2 for consistency with CXF, happy to bump.

Related: #25364 (resteasy client, separate PR).

cc @blaghed

PR checklist

  • Read the contribution guidelines.
  • 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.
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.
    @bbdouglas @sreeshas @jfiala @lukoyanov @cbornet @jeff9finger @karismann @Zomzog @lwlee2608 @martin-mfg @KannaKim

@Zouinek
Zouinek marked this pull request as ready for review October 26, 2026 00:07

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

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.

All reported issues were addressed across 5 files

Reply to a comment to ask cubic a question or push back. It learns from your replies.

View guided diff | Re-trigger cubic

@Zouinek

Zouinek commented Oct 26, 2026

Copy link
Copy Markdown
Author

While fixing the ensure-up-to-date failure I noticed that jaxrs-cxf-cdi extends JavaJAXRSSpecServerCodegen, so it inherited the new useJackson3 option.
Its own cxf-cdi/pom.mustache is still hardcoded to Jackson 2 (provider com.fastercml.jackson.jaxrs, Java 1.8), so enabling the option there would generate a project that does not compile.
In 491aee9 i disabled the option for jaxrs-cxf-cdi the same way useJspecify and serializationLibrary are already handled there (removeOption + forced off in processOpts()), covered by testUseJackson3IsIgnored.
If you'd like Jackson 3 support for jaxrs-cxf-cdi too, I'm happy to do that.

This branch has not been deployed

No deployments
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.

[REQ][jaxrs-spec] Support for Jackson 3 / useJackson3

1 participant