feature/jackson3 native (fixes #22294)#23071
feature/jackson3 native (fixes #22294)#23071thorstenhirsch wants to merge 6 commits intoOpenAPITools:masterfrom
Conversation
There was a problem hiding this comment.
4 issues found across 304 files
Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed.
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/Java/libraries/native/pom.mustache">
<violation number="1" location="modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache:268">
P1: Potential compile failure: When useJackson3=true, jackson-databind-nullable dependency is excluded from POM, but pojo.mustache still generates JsonNullable type references if openApiNullable is enabled (default). This causes compilation errors due to missing import org.openapitools.jackson.nullable.JsonNullable.</violation>
</file>
<file name="samples/client/petstore/java/native-jackson3/build.gradle">
<violation number="1" location="samples/client/petstore/java/native-jackson3/build.gradle:87">
P2: JUnit 5 is incompletely configured - missing engine dependency and useJUnitPlatform()</violation>
</file>
<file name="modules/openapi-generator/src/main/resources/Java/libraries/native/model.mustache">
<violation number="1" location="modules/openapi-generator/src/main/resources/Java/libraries/native/model.mustache:50">
P0: Incorrect Jackson 3 annotation package imports. The `jackson-annotations` module deliberately kept `com.fasterxml.jackson.annotation.*` package in Jackson 3 for backward compatibility - only core modules moved to `tools.jackson.*`. Fix: annotation imports should remain as `com.fasterxml.jackson.annotation.*` in the useJackson3 section.</violation>
</file>
<file name="samples/client/petstore/java/native-jackson3/docs/DefaultApi.md">
<violation number="1" location="samples/client/petstore/java/native-jackson3/docs/DefaultApi.md:73">
P2: Documentation method signature contains extra 'fooGet' token, resulting in invalid Java syntax 'ApiResponse<FooGetDefaultResponse> fooGet fooGetWithHttpInfo()'. Should be 'ApiResponse<FooGetDefaultResponse> fooGetWithHttpInfo()'.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
modules/openapi-generator/src/main/resources/Java/libraries/native/model.mustache
Outdated
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache
Show resolved
Hide resolved
samples/client/petstore/java/native-jackson3/docs/DefaultApi.md
Outdated
Show resolved
Hide resolved
...es/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java
Outdated
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache
Outdated
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache
Outdated
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache
Outdated
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache
Show resolved
Hide resolved
|
I'm not sure about the JUnit 5 changes in
Sounds reasonable to me. If you don't want them here, but in a separate PR instead, I will revert them here, of course. |
|
Alright, please do another code review @cubic-dev-ai |
@thorstenhirsch I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
3 issues found across 333 files
Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed.
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/java/native-jackson3/README.md">
<violation number="1" location="samples/client/petstore/java/native-jackson3/README.md:18">
P1: README incorrectly states Java 11+ requirement but Jackson 3 requires Java 17+. This documentation error will cause build/runtime failures for users following the instructions.</violation>
</file>
<file name="samples/client/petstore/java/native-jackson3/.travis.yml">
<violation number="1" location="samples/client/petstore/java/native-jackson3/.travis.yml:6">
P1: Travis CI uses JDK 11 (oraclejdk11) but Jackson 3.x requires Java 17+</violation>
</file>
<file name="modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache">
<violation number="1" location="modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache:4">
P1: JsonNullableModule is not registered when useJackson3 is enabled, breaking JsonNullable (de)serialization for models generated with openApiNullable=true</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache
Show resolved
Hide resolved
…on-databind-nullable
Add Jackson 3 support to java-native.
PR checklist
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.
master(upcoming7.x.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)"fixes #123"present in the PR description)@bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @martin-mfg (2023/08)
Summary by cubic
Adds opt-in Jackson 3 support to the Java native client generator while keeping Jackson 2 as default. Also fixes tests and docs, adds a Jackson 3 sample, and handles JsonNullable when jackson-databind-nullable is unavailable.
New Features
Migration
Written for commit 4e39fad. Summary will update on new commits.