How to run Swagger 3 on Spring Boot 3

I had given up and went to use Spring Boot 2.7 after posting the question. But, after seeing Dmitriy’s answer though, I checked Springdoc one last time and found that Springdoc v2 does support Spring Boot 3. Essentially, one has to place the following in their pom: <dependency> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> <version>2.0.0</version> </dependency> Then one can … Read more

Springfox swagger-ui.html unable to infer base URL – Caused by missing cookies

Add in the security config — following URLS that are skipped for authentication :: private static final String[] AUTH_WHITELIST = { “/swagger-resources/**”, “/swagger-ui.html”, “/v2/api-docs”, “/webjars/**” }; @Override public void configure(WebSecurity web) throws Exception { web.ignoring().antMatchers(AUTH_WHITELIST); }

swagger @ApiModelProperty example value for List property

I managed to get this to work, generating a List of Strings. Within the ApiModelProperty with springfox 2, write your example as follows: example = “[\”AddLine1\”,\”AddLine2\”,\”AddLine3\”,\”AddLine4\”]” Here is my example: @ApiModelProperty(value = “Address”, name = “addLines”, example = “[\”AddLine1\”,\”AddLine2\”,\”AddLine3\”,\”AddLine4\”]”) When I render the swagger page, I get the following output: “addLines”: [ “AddLine1”, “AddLine2”, “AddLine3”, … Read more

Added Springfox Swagger-UI and it’s not working, what am I missing?

Springfox 3.0.0 only works with Spring Boot <= 2.6.0-M2 but not with versions above it Options for Spring Boot 2.6 M2 < 1. spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER #-> App.properties     –    But without Actuator 2. @EnableWebMvc 3. Migrate to springdoc-openapi-ui – same steps as io.springfox >= 3.X io.springfox >= 2.X io.springfox >= 3.X <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.9.2</version></dependency><dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> … Read more

Api annotation’s description is deprecated

I found two solutions for Spring Boot application: 1. Swagger 2 based: Firstly, use the tags method for specify the tags definitions in your Docket bean: @Configuration @EnableSwagger2 public class Swagger2Config { public static final String TAG_1 = “tag1”; @Bean public Docket productApi() { return new Docket(DocumentationType.SWAGGER_2).select() .apis(RequestHandlerSelectors.basePackage(“my.package”)).build() .tags(new Tag(TAG_1, “Tag 1 description.”)) // Other … Read more

Failed to start bean ‘documentationPluginsBootstrapper’ in spring data rest

I got same issue using springfox-swagger2 and springfox-swagger-ui version(3.0.0), spring-boot version(2.6.2) The way to resolve this issue is by adding pathmatcher in application. properties or application.yml for application.properties: spring.mvc.pathmatch.matching-strategy = ANT_PATH_MATCHER for application.yml: spring: mvc: pathmatch: matching-strategy: ant_path_matcher

Spring Boot 2.6.0 / Spring fox 3 – Failed to start bean ‘documentationPluginsBootstrapper’

This problem’s caused by a bug in Springfox. It’s making an assumption about how Spring MVC is set up that doesn’t always hold true. Specifically, it’s assuming that MVC’s path matching will use the Ant-based path matcher and not the PathPattern-based matcher. PathPattern-based matching has been an option for some time now and is the … Read more

How to configure Spring Security to allow Swagger URL to be accessed without authentication

Adding this to your WebSecurityConfiguration class should do the trick. @Configuration public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter { @Override public void configure(WebSecurity web) throws Exception { web.ignoring().antMatchers(“/v2/api-docs”, “/configuration/ui”, “/swagger-resources/**”, “/configuration/security”, “/swagger-ui.html”, “/webjars/**”); } }