[Java] [apache-httpclient] Add support for Jackson3 for apache httpclient generator (fixes #22294)#23446
Conversation
There was a problem hiding this comment.
1 issue found across 231 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/apache-httpclient-jackson3/docs/FakeApi.md">
<violation number="1" location="samples/client/petstore/java/apache-httpclient-jackson3/docs/FakeApi.md:1007">
P2: Java example uses invalid enum literal `-efg`; should reference the generated enum constant (e.g., `EnumClass._EFG`).</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| String enumQueryString = "_abc"; // String | Query parameter enum test (string) | ||
| Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) | ||
| Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) | ||
| List<EnumClass> enumQueryModelArray = Arrays.asList(-efg); // List<EnumClass> | |
There was a problem hiding this comment.
P2: Java example uses invalid enum literal -efg; should reference the generated enum constant (e.g., EnumClass._EFG).
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/java/apache-httpclient-jackson3/docs/FakeApi.md, line 1007:
<comment>Java example uses invalid enum literal `-efg`; should reference the generated enum constant (e.g., `EnumClass._EFG`).</comment>
<file context>
@@ -0,0 +1,1541 @@
+ String enumQueryString = "_abc"; // String | Query parameter enum test (string)
+ Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double)
+ Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double)
+ List<EnumClass> enumQueryModelArray = Arrays.asList(-efg); // List<EnumClass> |
+ List<String> enumFormStringArray = Arrays.asList("$"); // List<String> | Form parameter enum test (string array)
+ String enumFormString = "_abc"; // String | Form parameter enum test (string)
</file context>
|
@cubic-dev-ai Please review everything except |
@maksimkurb I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
4 issues found across 231 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=".github/workflows/samples-java-client-jdk17.yaml">
<violation number="1" location=".github/workflows/samples-java-client-jdk17.yaml:17">
P2: Workflow path/matrix uses `samples/client/others/java/apache-httpclient-jackson3`, but the sample exists under `samples/client/petstore/java/apache-httpclient-jackson3`, so CI will miss changes or fail when running the matrix entry.</violation>
</file>
<file name="samples/client/echo_api/java/apache-httpclient/build.gradle">
<violation number="1" location="samples/client/echo_api/java/apache-httpclient/build.gradle:143">
P2: JUnit 5 test configuration is applied globally, including Android target builds, which can break Android test/build behavior.</violation>
</file>
<file name="samples/client/petstore/java/apache-httpclient-jackson3/build.sbt">
<violation number="1" location="samples/client/petstore/java/apache-httpclient-jackson3/build.sbt:1">
P2: build.sbt contains an invalid `#` comment, which will cause SBT parsing to fail and make the sample non-buildable.</violation>
</file>
<file name="docs/generators/java-microprofile.md">
<violation number="1" location="docs/generators/java-microprofile.md:100">
P2: `useJackson3` is documented as incompatible with `openApiNullable`, but the apache-httpclient templates now support JsonNullable with Jackson 3, so the docs are misleading.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| @@ -0,0 +1 @@ | |||
| # TODO | |||
There was a problem hiding this comment.
P2: build.sbt contains an invalid # comment, which will cause SBT parsing to fail and make the sample non-buildable.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/java/apache-httpclient-jackson3/build.sbt, line 1:
<comment>build.sbt contains an invalid `#` comment, which will cause SBT parsing to fail and make the sample non-buildable.</comment>
<file context>
@@ -0,0 +1 @@
+# TODO
</file context>
|
Hi @wing328 , I've received an email that you have approved workflow run and then CI/CD failed. I've pushed a commit with |
This PR continues work of #23071 and adds Jackson3 support for the apache-httpclient library.
Related issue: #22294
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 Jackson 3 support to the Java
apache-httpclientgenerator and enables OpenAPI Nullable withJsonNullableJackson3Moduleacross Jackson 3 clients. Fixes #22294.New Features
useJackson3=trueforapache-httpclient(Java 17); configuresJsonMapper,DateTimeFeature, andEnumFeature.JsonNullableJackson3Moduleinapache-httpclient,native, and Springresttemplate/webclient/restclient.samples/client/petstore/java/apache-httpclient-jackson3with Gradle/Maven; CI builds it on JDK 17/21.apache-httpclientsupport.Dependencies
tools.jackson(jackson-core,jackson-databind3.1.0) withcom.fasterxml.jackson.core:jackson-annotations2.21; addorg.openapitools:jackson-databind-nullable:0.2.10whenopenApiNullable=true.useJackson3is set; otherwise remain on Java 8. Gradle tests use JUnit Platform.echo_apiapache-httpclientsample updated to JUnit 5.Written for commit cac750d. Summary will update on new commits.