This repository has been archived by the owner. It is now read-only.
No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
ryankennedy Point new users to Carma-Public/swagger-jaxrs-doclet.
Carma-Public/swagger-jaxrs-doclet has been doing more recent development of this code on a fork. Point users there.
Latest commit e4bc8c8 Sep 16, 2014

Carma-Public/swagger-jaxrs-doclet has been doing more recent development on a fork of this project. Please consider checking that fork out first.

Swagger Doclet Build Status

A JavaDoc Doclet that can be used to generate a Swagger resource listing suitable for feeding to swagger-ui.


To use the Swagger Doclet in your Maven project, add the following to your POM file.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""


                            <additionalparam>-apiVersion 1 -docBasePath /apidocs -apiBasePath /</additionalparam>


An example project using Dropwizard is included in jaxrs-doclet-sample-dropwizard. To get it running, run the following commands.

$ cd jaxrs-doclet-sample-dropwizard
$ mvn package
$ java -jar target/jaxrs-doclet-sample-dropwizard-0.0.4-SNAPSHOT.jar server sample.yml

The example server should be running on port 8080:

$ curl localhost:8080/apidocs/service.json
  "apiVersion" : "1",
  "basePath" : "/apidocs/",
  "apis" : [ {
    "path" : "/Auth.{format}",
    "description" : ""
  }, {
    "path" : "/HttpServletRequest.{format}",
    "description" : ""
  }, {
    "path" : "/ModelResource_modelid.{format}",
    "description" : ""
  }, {
    "path" : "/Recursive.{format}",
    "description" : ""
  }, {
    "path" : "/Response.{format}",
    "description" : ""
  }, {
    "path" : "/greetings_name.{format}",
    "description" : ""
  } ],
  "swaggerVersion" : "1.1"

Override Swagger UI

To override the swagger ui included with the doclet, create your own file and add a swaggerUiZipPath to the additionalparam attribute in the pom file.

<additionalparam>-apiVersion 1 -docBasePath /apidocs -apiBasePath / -swaggerUiZipPath ../../../src/main/resources/</additionalparam>