0

I am trying to implement centralized swagger with openAPI 3.0 , but i am facing below issue:

  1. I am able to get all openApi json from all the microservice and add in concurrentHaspMap.

serviceDescriptions = new ConcurrentHashMap<String, String>(); serviceDescriptions.put(serviceName, serviceDescription);

In serviceDescriptions i have all OpenAPi Json.

  1. How to display this Json in OpenAPI UI?? please help me to display in OpenApi UI.
ashish969
  • 11
  • 2

1 Answers1

1

Here is the proper configuration:

springdoc.api-docs.enabled=false

With this setting, all the springdoc-openapi auto configuration beans are disabled.

Then you will have to enable the minimal beans configuration:

import org.springdoc.core.SpringDocConfigProperties
import org.springdoc.core.SpringDocConfiguration
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

@Configuration
class OpenAPIConfiguration {
    @Bean
    fun springDocConfiguration(): SpringDocConfiguration? {
        return SpringDocConfiguration()
    }

    @Bean
    fun springDocConfigProperties(): SpringDocConfigProperties? {
        return SpringDocConfigProperties()
    }
}

Then configure, the path of your custom UI yaml file.

#(or the path of json on in your case)
springdoc.swagger-ui.url=/api-docs.yaml 

Thats all :)