SpringBoot Epidsode 30 - Swagger UI

Опубликовано: 15 Март 2026
на канале: Umar Yakub Solanki
143
2

Step 1: add the dependencies to pom.xml
springfox-swagger-ui
springfox-swagger2

Step 2: application.properties
spring.mvc.pathmatch.matching-strategy=ant-path-matcher


Step 3 : make a new package by the name "config"

Step 4 : in the config package make a class "SwaggerConfig"

@EnableSwagger2
@Configuration
public class SwaggerConfig {

@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2).select()
.apis(RequestHandlerSelectors.basePackage(
"com.abc.xyz.controller"))
.build();
}
}

Step 5 : run the app
Step 6 : Open browser
type the url : http://localhost:8083/swagger-ui.html