Skip to content

Instantly share code, notes, and snippets.

@brunapereira
Created January 11, 2020 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brunapereira/52033b00a81ad885a60c2950eb371fb3 to your computer and use it in GitHub Desktop.
Save brunapereira/52033b00a81ad885a60c2950eb371fb3 to your computer and use it in GitHub Desktop.
@Configuration
class SwaggerResourceConfig {
@Primary
@Bean
fun swaggerResourcesProvider(defaultResourcesProvider: InMemorySwaggerResourcesProvider): SwaggerResourcesProvider {
return SwaggerResourcesProvider {
val resource = SwaggerResource()
resource.name = "Open API"
resource.swaggerVersion = "2.9.2"
resource.location = "/openapi.json" // troque pelo nome do arquivo que se encontra no diretório resources/public
val resources: ArrayList<SwaggerResource> = ArrayList(defaultResourcesProvider.get())
resources.add(resource)
resources
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment