Skip to content

add Spring Boot 3 server support, fully tested#320

Merged
davidmoten merged 29 commits into
masterfrom
sb3
Jun 26, 2025
Merged

add Spring Boot 3 server support, fully tested#320
davidmoten merged 29 commits into
masterfrom
sb3

Conversation

@davidmoten

@davidmoten davidmoten commented Jun 23, 2025

Copy link
Copy Markdown
Owner

There was a simple blocker for Spring Boot 3 server generation, being a change to the signature (return type) of ResponseEntity.getStatusCode() between Spring 5 and Spring 6.

This PR adds fully tested support for Spring Boot 3.

Changes include:

  • replace artifact openapi-codegen-spring-boot-runtime with Spring Boot version-specific artifacts:
    • openapi-codegen-spring-boot-2-runtime
    • openapi-codegen-spring-boot-3-runtime
  • addition of a new module openapi-codegen-spring-boot-core holding shared classes (is depended on by the above two dependencies so you don't need to explicitly add it)
  • migrate from slf4j 1.x to 2.x (no apparent problem running Spring Boot 2 test server)
  • copy all Spring Boot 2 tests and update for Spring Boot 3 (particularly to use jakarta.servlet-api and multipart support changes).
  • add springBoot2 and springBoot3 to accepted generatorTypes in the configuration of openapi-codegen-maven-plugin and deprecated spring2, spring3 (they still work as aliases for springBoot2 and springBoot3)
  • trim dependencies (for example javax.annotation only required for Spring Boot 2, and jackson deps were available transitively)
  • ensure just junit 5 used (there were a couple of junit 4 references)
  • remove unused junit-extras dependency
  • update openapi-codegen-pet-store-example project to use Spring Boot 3 (check that out to confirm the appropriate project setup for yourself)

As an aside the server-side code in openapi-codegen-maven-plugin-sb3-test module that demonstrates multipart handling can be simplified because Spring Boot 3 includes multipart features that make life easier. Contribution welcome!

There is only one breaking change for client generation being the move from slf4j 1.x to 2.x.

@davidmoten davidmoten changed the title add Spring Boot 3 support, fully tested add Spring Boot 3 server support, fully tested Jun 24, 2025
@davidmoten
davidmoten merged commit a9fbdec into master Jun 26, 2025
6 checks passed
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