我有一个简单的引导应用程序,其中添加了open swagger依赖项。
springdoc-openapi-ui
伴随着这些特性
springdoc.swagger-ui.disable-swagger-default-url=true
springdoc.swagger-ui.configUrl=/v3/api-docs/swagger-config
springdoc.swagger-ui.path=/swagger-ui.html
我得到了这些错误(当调用http://localhost:8080/swagger-ui/index.html时):
No API definition provided.
这是我的控制器:
@RestController
public class HelloWorld {
@GetMapping("sayHi")
public String sayHi(){
return "Hi Beno";
}
}
知道吗?
发布于 2022-04-01 07:54:04
当使用不同的端点来服务OpenAPI Config时,需要设置两个属性
// This will set UI to fetch the config's URL from "somePath"
springdoc.swagger-ui.configUrl=somePath
// You also need to serve the config file from the endpoint at "somePath"
springdoc.api-docs.path=somePath
https://stackoverflow.com/questions/71624864
复制相似问题