federecio / dropwizard-swagger

a Dropwizard bundle that serves Swagger UI static content and loads Swagger endpoints.
Other
130 stars 185 forks source link

dropwizard-swagger

a Dropwizard bundle that serves Swagger UI static content and loads Swagger endpoints. Swagger UI static content is taken from https://github.com/wordnik/swagger-ui

Current version has been tested with Dropwizard 0.8.0 and Swagger 1.5.1-M2 which supports Swagger 2 spec!

Note: if you come from previous versions there have been some changes in the way the bundle is configured, see details below.

License

http://www.apache.org/licenses/LICENSE-2.0

Version matrix

dropwizard-swagger Dropwizard Swagger API Swagger UI
< 0.5 0.7.x 1.3.2 ?
0.5.x 0.7.x 1.3.12 v2.1.4-M1
0.6.x 0.8.0 1.3.12 v2.1.4-M1
0.7.x 0.8.0 1.5.1-M2 v2.1.4-M1

How to use it

Sample Application

Take a look at this sample application that shows how to integrate DropWizard and Swagger: dropwizard-swagger-sample-app

Additional Swagger configuration

To see all the properties that can be used to customize Swagger see SwaggerBundleConfiguration.java

A note on Swagger 2

Host and port do not seem to be needed for Swagger 2 to work properly as it uses relative URLs. At the moment I haven't run through all the scenarios so some adjustments might be needed, please open a bug if you encounter any problems.

Contributors