Skip to content

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

@mjschwaiger

Description

@mjschwaiger

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions