swagger-api / swagger-core

Examples and server integrations for generating the Swagger API Specification, which enables easy access to your REST API
http://swagger.io
Apache License 2.0
7.37k stars 2.17k forks source link

Support jakarta.xml.bind-api for spring boot 3 apps #4609

Closed FoKas90 closed 7 months ago

FoKas90 commented 8 months ago

I've recently upgraded my spring boot project to version 3.1.1, therefore it doesn't have any javax.* dependencies. Also my project has dependency from swagger libs 2.2.20 in order to generate openrpc specs. I use ModelConverters in order to obtain ResolvedSchema. When ModelConverters.readAllAsResolvedSchema() is called my app fails with error ClassNotFoundException: javax.xml.bind.annotation.XmlElement because SwaggerAnnotationIntrospector depends on javax.xml.bind.annotation.XmlElement which doesn't exists in classpath.

I suggest provide support of jakarta.xml.bind-api so that swagger libs can be used within spring boot 3 apps

ivasilachi commented 7 months ago

Jakarta namespace is supported by dedicated artifacts, please see wiki

frantuma commented 7 months ago

@ivasilachi thanks for response and pointer, closing ticket