Skip to content

Use another petstore spec for testing Java clients with Jackson 3 support#23115

Merged
wing328 merged 1 commit intomasterfrom
java-update-samples
Mar 4, 2026
Merged

Use another petstore spec for testing Java clients with Jackson 3 support#23115
wing328 merged 1 commit intomasterfrom
java-update-samples

Conversation

@wing328
Copy link
Member

@wing328 wing328 commented Mar 4, 2026

a follow up PR to #23023 to reduce number of test files (models)

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

Switch Java restclient Spring Boot 4 samples to the minimal petstore-addpet-only spec to better isolate and validate Jackson 3 support. This trims the sample surface area and updates generated code to the simplified API.

  • Refactors
    • Pointed jackson2 and jackson3 configs to modules/openapi-generator/src/test/resources/3_0/petstore-addpet-only.yaml.
    • Regenerated jackson2 samples: removed fake APIs/models; kept PetApi.addPet and Pet/Category/Tag models.
    • Updated base URL to http://petstore.swagger.io/v2 and refreshed docs/comments accordingly.
    • Applied spec-driven model tweaks: Pet.photoUrls is now List (was Set); Category.name is optional; added brief model descriptions.

Written for commit 27422bf. Summary will update on new commits.

@wing328 wing328 changed the title use another petstore spec for testing java jackson 3 support Use another petstore spec for testing Java clients with Jackson 3 support Mar 4, 2026
@wing328 wing328 marked this pull request as ready for review March 4, 2026 16:49
Copy link
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 376 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/restclient-springBoot4-jackson2/README.md">

<violation number="1" location="samples/client/petstore/java/restclient-springBoot4-jackson2/README.md:9">
P2: The new intro text incorrectly tells users to use an API key (`special-key`), but this generated client README is configured for OAuth (`petstore_auth`). Update the sentence to avoid misleading authentication instructions.</violation>
</file>

<file name="samples/client/petstore/java/restclient-springBoot4-jackson3/README.md">

<violation number="1" location="samples/client/petstore/java/restclient-springBoot4-jackson3/README.md:9">
P2: The README now documents an `api key` (`special-key`) even though this generated sample only documents OAuth (`petstore_auth`), causing contradictory authentication guidance.</violation>
</file>

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

- Generator version: 7.21.0-SNAPSHOT

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 4, 2026

Choose a reason for hiding this comment

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

P2: The new intro text incorrectly tells users to use an API key (special-key), but this generated client README is configured for OAuth (petstore_auth). Update the sentence to avoid misleading authentication instructions.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/java/restclient-springBoot4-jackson2/README.md, line 9:

<comment>The new intro text incorrectly tells users to use an API key (`special-key`), but this generated client README is configured for OAuth (`petstore_auth`). Update the sentence to avoid misleading authentication instructions.</comment>

<file context>
@@ -6,7 +6,7 @@ OpenAPI Petstore
 - Generator version: 7.21.0-SNAPSHOT
 
-This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
 
 
</file context>
Suggested change
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
This is a sample Petstore client. For this sample, configure an OAuth2 access token for `petstore_auth` when calling secured endpoints.
Fix with Cubic

@@ -6,7 +6,7 @@ OpenAPI Petstore

- Generator version: 7.21.0-SNAPSHOT

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 4, 2026

Choose a reason for hiding this comment

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

P2: The README now documents an api key (special-key) even though this generated sample only documents OAuth (petstore_auth), causing contradictory authentication guidance.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/java/restclient-springBoot4-jackson3/README.md, line 9:

<comment>The README now documents an `api key` (`special-key`) even though this generated sample only documents OAuth (`petstore_auth`), causing contradictory authentication guidance.</comment>

<file context>
@@ -6,7 +6,7 @@ OpenAPI Petstore
 - Generator version: 7.21.0-SNAPSHOT
 
-This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
 
 
</file context>
Suggested change
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
This is a sample Petstore server. Use OAuth `petstore_auth` (as shown below) to test authorization.
Fix with Cubic

@wing328 wing328 merged commit 80f2d7f into master Mar 4, 2026
176 checks passed
@wing328 wing328 deleted the java-update-samples branch March 4, 2026 17:14
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