SKJ
SKJ

Reputation: 11

Springfox 2.5.0 is not working with Spring 5.3.31

While upgrading the Spring version, io.springfox : springfox-swagger2:2.5.0 & io.springfox : springfox-swagger-ui:2.5.0 are not working with spring 5.3.31. Swagger UI is not loading properly, there is no such error or exception in the logs. Can you please have a look and help me with this.

I changed io.springfox : springfox-swagger2 & io.springfox : springfox-swagger-ui to 3.0.0 but it is not working. I tried with 2.9.2 version as well but same issue.

Upvotes: 1

Views: 328

Answers (2)

if you are working with a lower version of springboot (2.4 ->2.7) try working with

    <dependency>
        <groupId>org.springdoc</groupId>
        <artifactId>springdoc-openapi-ui</artifactId>
        <version>1.6.11</version> <!--- old version from 2021 -->
    </dependency>

also add this to your properties :

## Swagger-ui & Documentation
springdoc.packages-to-scan=de.xqueue.txe.api.controllers
springdoc.api-docs.enabled=true
springdoc.swagger-ui.path=/swagger-ui.html
springdoc.api-docs.path=/api-docs
springdoc.swagger-ui.enabled=true
springdoc.swagger-ui.operationsSorter=method
springdoc.swagger-ui.tryItOutEnabled=true
springdoc.swagger-ui.filter=false
springdoc.swagger-ui.tagsSorter=alpha
springdoc.swagger-ui.validatorUrl=none
springdoc.swagger-ui.defaultModelRendering=model
springdoc.swagger-ui.docExpansion=full

Upvotes: 0

SledgeHammer
SledgeHammer

Reputation: 7736

Springfox was abandoned like 4 or 5 years ago. Use Springdocs instead.

Upvotes: 1

Related Questions