[Swagger] swagger-ui.html 404

갓김치·2021년 6월 1일
0

예외

목록 보기
5/28
post-custom-banner

dependency

<dependency>
  <groupId>io.springfox</groupId>
  <artifactId>springfox-swagger2</artifactId>
  <version>2.9.1</version>
</dependency>
<!-- swagger ui -->
<dependency>
  <groupId>io.springfox</groupId>
  <artifactId>springfox-swagger-ui</artifactId>
  <version>2.9.1</version>
</dependency>

as-is

@EnableSwagger2
@Configuration
public class SwaggerConfig extends WebMvcConfigurationSupport {

...

@Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/swagger-ui.html")
                .addResourceLocations("classpath:/META-INF/resources/");
        registry.addResourceHandler("/webjars/**")
                .addResourceLocations("classpath:/META-INF/resources/webjars/");
    }

...

}

to-be

@EnableSwagger2
@Configuration
public class SwaggerConfig implements WebMvcConfigurer {

...

@Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/swagger-ui.html")
                .addResourceLocations("classpath:/META-INF/resources/");
        registry.addResourceHandler("/webjars/**")
                .addResourceLocations("classpath:/META-INF/resources/webjars/");
    }

...

}
  • WebMvcConfigurer를 implement하는 것으로 수정
  • method override는 안해도 되는 것 같지만 우선 둔다.

AbstractSerializableParameter

  • Illegal DefaultValue null for parameter type integer 예외 발생
profile
갈 길이 멀다
post-custom-banner

0개의 댓글