Skip to content

mgorav/swagger-aggregator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swagger Aggregator

A Spring BOOT application which aggregates/consolidates all the swagger definitions using springfox (APIS catalog). This app if added to Spring BOOT based Netflix Zuul (API Gateway) will provide complete API gateway features like paid product Swagger Hub. Also aggregation of all the APIs definition can be of great help for QA testing team. It can also help in autonating API testing using cucumber.

NOTE: Possible extension(s)

  1. SwaggerPropertyResourceProvider can be easily extended to add all the micro services based swagger definition from service registry like consul.This can be achieved by adding Spring Cloud (consul) to pom.xml using DiscoveryClient. Alternatively, one can load Swagger definition from DB also.

  2. Currently Swagger Aggregator consolidates all swagger definition defined in application.yml as shown below:

       documentation:
         swagger:
           services:
             -
               name: My Pet Service
               url: http://petstore.swagger.io/v2/swagger.json
               version: 2.0
             -
               name: Pet Professional SERVICES
               url: http://petstore.swagger.io/v2/swagger.json
               version: 2.0
             -
               name: Hobby Pet Service
               url: http://petstore.swagger.io/v2/swagger.json
               version: 2.0
             -
               name: Pet Food Service
               url: http://petstore.swagger.io/v2/swagger.json
               version: 2.0
  3. Swagger Aggregator application.yml is defined out side the application in the config folder. This provides ease in changing the application properties without building application again

Run Swagger Aggregator

Use following commands to run Swagger Aggregator app:

  1. mvn clean install
  2. java -jar target/swagger-aggregator-0.0.1-SNAPSHOT.jar

Hit following URL to see aggregator UI:

http://localhost:8000/swagger-ui.html or http://localhost:8000/swagger

NOTE: On top right corner in combo box, all the swagger defintion specified in applicaiton.yml will be visible

alt text

About

Aggregate Swagger Defintion

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages