Skip to content

feat: add spring-boot4 petstore sample, tests and CI workflow - #12791

Open
daniel-kmiecik wants to merge 1 commit into
3.0.0from
handle-spring-boot-4-workflow
Open

daniel-kmiecik wants to merge 1 commit into
3.0.0from
handle-spring-boot-4-workflow

Conversation

@daniel-kmiecik

Copy link
Copy Markdown
Contributor

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: 3.0.0 branch for changes related to OpenAPI spec 3.0. Default: master.

Description of the PR

Summary

Adds a petstore sample for the Spring Boot 4 / Jackson 3 server, generated with the spring-boot4 library from generators. Also adds the bin script that regenerates it, JUnit 5 custom tests, and a CI workflow that builds the sample on JDK 17 and 21.

Depends on the generators PR that adds the spring-boot4 library. This PR is not expected to build until that generators version is released and this pom points to it .

What changed

  • Sample samples/server/petstore/springboot-4/: generated with --library spring-boot4 from the petstore spec. Includes pom.xml (Spring Boot 4.1.3, maven.compiler.release 21), API interfaces with default methods, thin controllers, models and configuration.
  • Bin script bin/springboot4-petstore-server.sh: regenerates the sample from the same spec, in the same style as the existing Spring scripts.
  • Custom tests samples/custom-tests/spring/v3/springboot4/: JUnit 5 tests for PetApi, StoreApi and UserApi. They autowire the generated interfaces and use petstore-with-issue-cases.yaml, the same spec as the CI job.
  • CI workflow .github/workflows/test-framework-v3-springboot4.yml: workflow_dispatch only. Builds the codegen CLI, generates the sample with --library spring-boot4, copies the custom tests in and builds the sample on JDK 17 and 21. Uploads outcomes and logs per JDK.
  • pom.xml and pom.docker.xml: the javadoc report config uses reportSets with the aggregate report instead of the aggregate configuration, and drops the javadoc.package.exclude reference. Fixes the IDE validation errors on these poms.

Testing

  • Sample builds and runs on Spring Boot 4.1.3 with JDK 17 and 21.
  • Custom tests pass 18 of 18 on JDK 17 and 21 with the spec used by the workflow.
  • Endpoints checked on the running sample: API docs and Swagger UI return 200, example endpoints return 501 with example JSON, and a request missing a required field returns 400.

Dependencies

  • pom.xml uses swagger-codegen-generators 1.0.63. This must be a version that contains the spring-boot4 library. Merge the generators PR and release first, then point this pom at that version.
  • The sample was generated with a local 1.0.63-SNAPSHOT build of generators that includes the spring-boot4 library. Regenerating it with the released version should give the same output.

Not verified yet

  • The workflow has not run on GitHub. It is workflow_dispatch only, so it has to be started manually on the 3.0.0 branch after merge.

@daniel-kmiecik
daniel-kmiecik force-pushed the handle-spring-boot-4-workflow branch from 4d4a134 to 0061dfe Compare November 24, 2026 12:46
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