Skip to content

Instantly share code, notes, and snippets.

@schroedermatt
Last active September 4, 2017 19:11
Show Gist options
  • Save schroedermatt/35ba75a8822f76cc40bac4481314ed16 to your computer and use it in GitHub Desktop.
Save schroedermatt/35ba75a8822f76cc40bac4481314ed16 to your computer and use it in GitHub Desktop.
Swagger Aggregate
documentation:
swagger:
services:
-
name: Animal Service
url: /animals/api-docs
version: 2.0
-
name: Human Service
url: /humans/api-docs
version: 2.0
compile ('io.springfox:springfox-swagger-ui:2.7.0')
compile ('io.springfox:springfox-swagger2:2.7.0')
class PropertyResourceProvider implements SwaggerResourcesProvider {
// application.yml props get wired into this config
@Autowired
private SwaggerServicesConfig config
@Override
List get() {
config.services.collect { svc ->
new SwaggerResource(
name: svc.name,
location: svc.url,
swaggerVersion: svc.version
)
}
}
}
springfox:
documentation:
swagger:
v2:
path: /{service-name}/api-docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment