Home > Software engineering >  Swagger error Springboot Could not resolve view with name 'forward:/swagger-ui/index.html'
Swagger error Springboot Could not resolve view with name 'forward:/swagger-ui/index.html'

Time:05-24

Springboot 2.5.13, swagger2: implementation "io.springfox:springfox-boot-starter:3.0.0" implementation "io.springfox:springfox-swagger-ui:3.0.0"

Runtime error: Could not resolve view with name 'forward:/swagger-ui/index.html'

CodePudding user response:

The solution: create a bean like this:

  @Bean
  public InternalResourceViewResolver defaultViewResolver() {
    return new InternalResourceViewResolver();
  }

source: https://github.com/springdoc/springdoc-openapi/issues/236

  • Related