You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

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:

Error formatting macro: snippet: java.lang.NullPointerException

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.versionStringSwagger spec version. Is default 1.2.
base.path

 

StringRequired: To setup the base path where the API is available
api.versionStringThe version of the api. Is default 0.0.0.
api.pathStringPath of the api
api.titleStringRequired. The title of the application.
api.descriptionStringRequired. A short description of the application.
api.termsOfServiceUrlStringA URL to the Terms of Service of the API.
api.contactStringAn email to be used for API-related correspondence.
api.licenseStringThe license name used for the API.
api.licenseUrlStringA URL to the license used for the API.

Examples

TODO: rest example

  • No labels