This example demonstrates how to integrate Swagger with Jersey 2 running on Grizzly 2.
The mapping of the URI path space is presented in the following table:
URI path | Resource class | HTTP methods | Notes |
---|---|---|---|
/base/helloworld | HelloWorldResource | GET | Returns Hello World! |
/base/swagger.json | _ | GET | Returns Swagger JSON |
Run the example as follows:
mvn clean compile exec:java
This deploys the example using Grizzly container.
The example does not integrate the Swagger UI.
The example uses the library 'jersey-container-grizzly2-servlet' instead of the 'jersey-container-grizzly2-http' to get the ServletConfig class required by Swagger.