【发布时间】:2023-04-01 10:23:01
【问题描述】:
不工作 /v2/api-docs 返回 404
此时在日志中 - Swagger2Controller: Unable to find specification for group default
Beans Docker 在春季创建 ok... 但是 Swagger2Controller.DocumentationCache 是空的...
请帮帮我.....
以前,这是工作......
@EnableSwagger2
@Configuration
class SwaggerConfig {
@Bean
fun allApi(): Docket {
return Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build()
}
}
分级:
compile('org.springframework.boot:spring-boot-starter-actuator')
compile('org.springframework.boot:spring-boot-starter-aop')
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot')
// Rest
compile('org.springframework.boot:spring-boot-starter-data-rest')
// Web
compile('org.springframework.boot:spring-boot-starter-thymeleaf')
compile('org.springframework.boot:spring-boot-starter-web')
// Security
compile('org.springframework.security:spring-security-web')
compile('org.springframework.security:spring-security-config')
// Jackson
compile('com.fasterxml.jackson.module:jackson-module-kotlin')
// Vaadin
compile('com.vaadin:vaadin-spring-boot-starter')
// DB
runtime('org.postgresql:postgresql')
// Kotlin
compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
compile("org.jetbrains.kotlin:kotlin-reflect")
// Sentry
compile 'io.sentry:sentry:1.7.2'
compile 'com.getsentry.raven:raven-logback:8.0.3'
// Log to json
compile('ch.qos.logback.contrib:logback-json-classic:0.1.5')
compile "net.logstash.logback:logstash-logback-encoder:5.0"
// Logs {IF}
compile "org.codehaus.janino:janino"
// Swagger
compile "io.springfox:springfox-swagger2:2.9.2"
【问题讨论】:
-
避免在您的问题中添加“已解决”或类似标题。如果下面的答案回答了这个问题,请通过点击答案左侧的绿色复选标记将其标记为已接受。