Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring boot 3 and Swagger ui java.lang.NoSuchMethodError: 'io.swagger.v3.oas.annotations.media.Schema$AdditionalPropertiesValue additionalProperties() [closed]

I'm having an issue with swagger ui after upgrading to spring boot 3. The swagger-ui doesn't work anymore and I got a 404 and "White Label" page as response.

After taking a closer look, I need to change from: implementation(group: 'org.springdoc', name: 'springdoc-openapi-ui', version: '1.5.8')

to: implementation(group: 'org.springdoc', name: 'springdoc-openapi-starter-webmvc-ui', version: '2.0.3')

After that, it did work. However, in one of my other projects we had an issue with a dependency conflict, so the swagger-ui was throwing a 500 where trying to the fetch the /v3/api-docs/: between: io.confluent:kafka-avro-serializer:7.3.1 and springdoc-openapi-starter-webmvc-ui:2.0.3 Those 2 dependencies need to use io.swagger.core.v3:swagger-annotations-jakarta, but with different versions

So in gradle I had to resolve the conflict to force io.swagger.core.v3:swagger-annotations-jakarta:2.2.8.

like image 660
clever-developer Avatar asked Dec 02 '25 06:12

clever-developer


1 Answers

In my case, even though I have springdoc-openapi-starter-webmvc-ui i also had to add this dependency

mvn

<dependency>
    <groupId>io.swagger.core.v3</groupId>
    <artifactId>swagger-annotations</artifactId>
    <version>2.2.16</version>
</dependency>
like image 107
mr nooby noob Avatar answered Dec 03 '25 23:12

mr nooby noob



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!