Add support for Jakarta EE
See original GitHub issueIs your feature request related to a problem? Please describe. When using springdoc-openapi-ui, one gets a dependency to the old javax-apis through the version of swagger-core that is included (via springdoc-common).
Describe the solution you’d like It seems swagger has solved this by publishing separate artifacts suffixed with jakarta (See https://github.com/swagger-api/swagger-core/pull/3881). It would be nice if one could do the same with springdoc, or if possible solve it in some other way, so as not have to manually exclude the javax-swagger-versions and include the jakarta-swagger versions a la
implementation(
'io.swagger.core.v3:swagger-annotations-jakarta:2.1.11',
'io.swagger.core.v3:swagger-integration-jakarta:2.1.11',
'io.swagger.core.v3:swagger-models-jakarta:2.1.11'
)
implementation('org.springdoc:springdoc-openapi-ui:1.5.11') {
exclude(group: 'io.swagger.core.v3', module: 'swagger-annotations')
exclude(group: 'io.swagger.core.v3', module: 'swagger-integration')
exclude(group: 'io.swagger.core.v3', module: 'swagger-models')
}
I’m not well enough versed in all the possibilities of configuring dependencies in maven to come up with the best solution to this, but it would be nice if it could be solved somehow, as jakarta.* is where the development will continue.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:9
- Comments:27 (10 by maintainers)
just found this issue after upgrading to Spring Boot 3.0 M1 … OpenAPI crashes by trying to use Reflection for javax Classes (like Servlet) … which our now gone / replaced by the jakarta ee namespace …
SpringDoc Version is 1.6.4
Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpServletRequest at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) ~[na:na] at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) ~[na:na] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[na:na]
Hi @goafabric,
The support has been added in
springdoc-openapi 2
branch. For now we will SupportJakarta EE 9
andSpring-Boot 3
.springdoc-openapi v2
will requireJava 17
as a minimum version andSpring Boot 3.x
springdoc-openapi v2
will be released oncespring-Boot 3
goes G.A.This is the link for the demos code:
If you want to give it a try, this is a first version of the documentation updated here:
And this is the migration steps:
Note:
spring-cloud
andspring-native
are not yet ready for spring-boot 3 support.Please feel free to use and test the latest SNAPSHOT:
springdoc-openapi v2.0.0-SNAPSHOT
.Don’t hesitate to provide your comments in this ticket.