All Projects → smoketurner → dropwizard-swagger

smoketurner / dropwizard-swagger

Licence: Apache-2.0 license
a Dropwizard bundle that serves Swagger UI static content and loads Swagger endpoints.

Projects that are alternatives of or similar to dropwizard-swagger

Node Measured
A Node metrics library for measuring and reporting application-level metrics, inspired by Coda Hale, Yammer Inc's Dropwizard Metrics Libraries
Stars: ✭ 500 (+184.09%)
Mutual labels:  dropwizard
Metrics Cdi
CDI extension for Dropwizard Metrics
Stars: ✭ 76 (-56.82%)
Mutual labels:  dropwizard
Jax Rs Performance Comparison
⚡️ Performance Comparison of Jax-RS implementations and embedded containers
Stars: ✭ 181 (+2.84%)
Mutual labels:  dropwizard
Dropwizard Hk2bundle
Dropwizard hk2 integration bundle
Stars: ✭ 12 (-93.18%)
Mutual labels:  dropwizard
Dropwizard Cassandra
Dropwizard support for Cassandra
Stars: ✭ 60 (-65.91%)
Mutual labels:  dropwizard
Melon
Melon 🍈 - Dropwizard-like web service framework in Go (golang)
Stars: ✭ 111 (-36.93%)
Mutual labels:  dropwizard
Ratelimitj
A Java library for Rate-Limiting, providing extensible storage and application framework adaptors.
Stars: ✭ 362 (+105.68%)
Mutual labels:  dropwizard
dropwizard-elasticsearch
A set of classes for using Elasticsearch in a Dropwizard service.
Stars: ✭ 61 (-65.34%)
Mutual labels:  dropwizard
Clojure News Feed
evaluating various technologies by implementing a news feed micro-service
Stars: ✭ 65 (-63.07%)
Mutual labels:  dropwizard
Pac4j
Security engine for Java (authentication, authorization, multi frameworks): OAuth, CAS, SAML, OpenID Connect, LDAP, JWT...
Stars: ✭ 2,097 (+1091.48%)
Mutual labels:  dropwizard
Dropwizard Jwt Cookie Authentication
Dropwizard bundle managing authentication through JWT cookies
Stars: ✭ 29 (-83.52%)
Mutual labels:  dropwizard
Dropwizard
A damn simple library for building production-ready RESTful web services.
Stars: ✭ 8,078 (+4489.77%)
Mutual labels:  dropwizard
Dropwizard Jobs
Scheduling / Quartz integration for Dropwizard
Stars: ✭ 132 (-25%)
Mutual labels:  dropwizard
Metrics Jvm Extras
A set of additional metrics complementing Dropwizards metrics-jvm.
Stars: ✭ 10 (-94.32%)
Mutual labels:  dropwizard
Stubbornjava
Unconventional Java code for building web servers / services without a framework. Think dropwizard but as a seed project instead of a framework. If this project had a theme it would be break the rules but be mindful of your decisions.
Stars: ✭ 184 (+4.55%)
Mutual labels:  dropwizard
Guardrail
Principled code generation from OpenAPI specifications
Stars: ✭ 396 (+125%)
Mutual labels:  dropwizard
Rufus
Rufus - fetches the paper for you!
Stars: ✭ 108 (-38.64%)
Mutual labels:  dropwizard
keycloak-dropwizard-integration
This project shows how JBoss Keycloak and Dropwizard can be used together.
Stars: ✭ 49 (-72.16%)
Mutual labels:  dropwizard
Dropwizard Guicey
Dropwizard guice integration
Stars: ✭ 197 (+11.93%)
Mutual labels:  dropwizard
Hikaku
A library that tests if the implementation of a REST-API meets its specification.
Stars: ✭ 154 (-12.5%)
Mutual labels:  dropwizard

dropwizard-swagger

Build Status Coverage Status Maven Central GitHub license Become a Patron

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

Current version has been tested with Dropwizard 2.0.0 and Swagger 1.6.0 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.x 1.5.1-M2 v2.1.4-M1
0.7.2 0.8.4 1.5.3 v2.1.2
0.9.x 0.9.x 1.5.9 v2.1.5
1.0.x 1.0.x 1.5.12 v2.2.10
1.1.x 1.1.x 1.5.16 v2.2.10
1.2.x 1.2.x 1.5.18 v3.9.2
1.3.x 1.3.x 1.5.22 v3.23.0
2.0.x 2.0.x 1.6.0 v3.24.3

How to use it

  • Add the Maven dependency (available in Maven Central)
<dependency>
    <groupId>com.smoketurner</groupId>
    <artifactId>dropwizard-swagger</artifactId>
    <version>2.0.0-1</version>
</dependency>
  • Add the following to your Configuration class:
public class YourConfiguration extends Configuration {

    @JsonProperty("swagger")
    public SwaggerBundleConfiguration swaggerBundleConfiguration;
  • Add the following your configuration yaml (this is the minimal configuration you need):
prop1: value1
prop2: value2

# the only required property is resourcePackage, for more config options see below
swagger:
  resourcePackage: <a comma separated string of the packages that contain your @Api annotated resources>
  • In your Application class:
@Override
public void initialize(Bootstrap<YourConfiguration> bootstrap) {
    bootstrap.addBundle(new SwaggerBundle<YourConfiguration>() {
        @Override
        protected SwaggerBundleConfiguration getSwaggerBundleConfiguration(YourConfiguration configuration) {
            return configuration.swaggerBundleConfiguration;
        }
    });
}
  • As usual, add Swagger annotations to your resource classes and methods

  • Open a browser and hit http://localhost:<your_port>/swagger

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].