Im using spring boot 2.3.2.RELEASE with spring-cloud-config-server 2.2.4.RELEASE. Im trying to implement the spring-doc-openapi (1.4.3) in a existing project. If i add @EnableConfigServer in one the configuration class file, the swagger-ui.html endpoint returns a weird json:
"name":"swagger-ui",
"profiles":[
"index.html"
],
"label":null,
"version":null,
"state":null,
"propertySources":[
]
}
and not the the swagger ui as expected. Im not sure if its a bug, but would appreciate any kind of help.
Answer from @brianbro seems not to be working anymore...
Verified on:
springdoc-openapi v1.6.6andorg.springframework.cloud:spring-cloud-config-server:v2.2.4.RELEASEHere is how I solved it:
List item
spring.cloud.config.server.prefix=config-server- please note that any request to config server will require to add prefix!Add following bean (sample implementation in Kotlin)
Now you should be able to reach swagger ui :)