Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The swagger module can be configured using the following options. To configure using a servlet you use the init-param as shown above. When configuring directly in the rest-dsl, you use the the appropriate method, such as enableCORShost,contextPath, dsl. The options with api.xxx is configured using apiProperty dsl.

Div
classconfluenceTableSmall

Option

Type

Description

corsBooleanWhether to enable CORS. Notice this only enables CORS for the api browser, and not the actual access to the REST services. Is default false.
Instead of using this option is recommended to use the CorsFilte, see further below.
swagger.versionStringSwagger spec version. Is default 2.0.
hostStringTo setup the hostname. If not configured camel-swagger-java will calculate the name as localhost based.
schemasStringThe protocol schemas to use. Multiple values can be separated by comma such as "http,https". The default value is "http".
base.path

 

String

Required: To setup the base path where the REST services is available. The path is relative (eg do not start with http/https) and camel-swagger-java will calculate the absolute base path at runtime, which will be

Code Block
protocol://host:port/context-path/base.path
api.pathString

To setup the path where the API is available (eg /api-docs). The path is relative (eg do not start with http/https) and camel-swagger-java will calculate the absolute base path at runtime, which will be

Code Block
protocol://host:port/context-path/api.path

So using relative paths is much easier. See above for an example.

api.versionStringThe version of the api. Is default 0.0.0.
api.titleStringThe title of the application.
api.descriptionStringA short description of the application.
api.termsOfServiceStringA URL to the Terms of Service of the API.
api.contact.nameStringName of person or organization to contact
api.contact.emailStringAn email to be used for API-related correspondence.
api.contact.urlStringA URL to a website for more contact information.
api.license.nameStringThe license name used for the API.
api.license.urlStringA URL to the license used for the API.
apiContextIdListingbooleanWhether to allow listing all the CamelContext names in the JVM that has REST services. When enabled then the root path of the api-doc will list all the contexts. When disabled then no context ids is listed and the root path of the api-doc lists the current CamelContext. Is default false.
apiContextIdPatternStringA pattern that allows to filter which CamelContext names is shown in the context listing. The pattern is using regular expression and * as wildcard. Its the same pattern matching as used by Intercept

...