Swagger Component
Available as of Camel 2.14
The Rest DSL can be integrated with the camel-swagger
module which is used for exposing the REST services and their APIs using Swagger.
Maven users will need to add the following dependency to their pom.xml
for this component:
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-swagger</artifactId> <version>x.x.x</version> <!-- use the same version as your Camel core version --> </dependency>
Using
To use this you need to configure the org.apache.camel.component.swagger.RestSwaggerApiDeclarationServlet
in the WEB-INF/web.xml
file as shown below:
Options
The org.apache.camel.component.swagger.RestSwaggerApiDeclarationServlet
supports the following options which can be configured as context-param in the web.xml file.
Option | Type | Description |
---|---|---|
swagger.version | String | Swagger spec version. Is default 1.2. |
base.path
| String | Required: To setup the base path where the API is available |
api.version | String | The version of the api. Is default 0.0.0. |
api.path | String | Path of the api |
api.title | String | Required. The title of the application. |
api.description | String | Required. A short description of the application. |
api.termsOfServiceUrl | String | A URL to the Terms of Service of the API. |
api.contact | String | An email to be used for API-related correspondence. |
api.license | String | The license name used for the API. |
api.licenseUrl | String | A URL to the license used for the API. |
Examples
TODO: rest example