Last active
September 4, 2017 19:11
-
-
Save schroedermatt/35ba75a8822f76cc40bac4481314ed16 to your computer and use it in GitHub Desktop.
Swagger Aggregate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
documentation: | |
swagger: | |
services: | |
- | |
name: Animal Service | |
url: /animals/api-docs | |
version: 2.0 | |
- | |
name: Human Service | |
url: /humans/api-docs | |
version: 2.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compile ('io.springfox:springfox-swagger-ui:2.7.0') | |
compile ('io.springfox:springfox-swagger2:2.7.0') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
) | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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