Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect version of jakarta.validation-api 3.1.0 instead of 3.0.2 starting with springdoc-openapi-starter-webmvc-ui 2.7.0 #2936

Closed
mjschwaiger opened this issue Mar 11, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@mjschwaiger
Copy link

mjschwaiger commented Mar 11, 2025

Describe the bug
Versions of swagger-core-jakarta introducing jakarta.validation-api:3.1.0 are used in springdoc-openapi-starter-common starting with 2.7.0.

Version 2.2.25 and newer of swagger-core-jakarta and define version 3.1.0 instead of 3.0.2 of component jakarta.validation-api.

jakarta.validation-api:3.1.0 is part of Jakarta EE 11, but Spring Boot 3.x is based on Jakarta EE 10, and therefore jakarta.validation-api:3.0.2 should be used.

For more details see swagger-api/swagger-core#4849.

To Reproduce
Example: this would resolve to jakarta.validation-api:3.1.0 which is the release for Jakarta EE 11

dependencies {
  implementation("org.springframework.boot:spring-boot-starter:3.4.3") /* based on Jakarta EE 10 */
  implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.5")
}

Expected behavior
In fact, you would expect the example above to resolve to jakarta.validation-api:3.0.2 (Jakarta EE 10).

Possible solution
An update of springdoc-openapi-starter-common to swagger-core-jakarta version 2.29 should fix this issue, as it has already been fixed in the pull request 4853 of the swagger-core project.

Hopefully this update to swagger-core-jakarta version 2.29 will be included in the next release of org.springdoc:springdoc-openapi-starter-webmvc-ui.

Additional context
This issue is more of a documentation issue to help people who are also looking for this problem.

Versions of Jakarta (Bean) Validation:

See https://jakarta.ee/specifications/bean-validation/ for more details.

The baseline for Spring Boot 3.x and Spring Framework 6.x is Jakarta EE 10, so components such as springdoc-openapi-starter-webmvc-ui (actually, the origin of the problem is swagger-core-jakarta) should not update this baseline to versions based on Jakarta EE 11, which will be the baseline for Spring Boot 4.x and Spring Framework 7.x.

@mjschwaiger
Copy link
Author

mjschwaiger commented Mar 20, 2025

✅ Should be fixed with commit 50b2fa8 by upgrading swagger-core to 2.2.29

@bnasslahsen bnasslahsen added the bug Something isn't working label Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants