Search

Chapter 336. Options

download PDF

The OpenApi 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 appropriate method, such as enableCORS, host,contextPath, dsl. The options with api.xxx is configured using apiProperty dsl.

OptionTypeDescription

cors

Boolean

Whether to enable CORS. Notice this only enables CORS for the api browser, and not the actual access to the REST services. Is default false.

openapi.version

String

OpenApi spec version. Is default 3.0.

host

String

To setup the hostname. If not configured camel-openapi-java will calculate the name as localhost based.

schemes

String

The protocol schemes 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-openapi-java will calculate the absolute base path at runtime, which will be protocol://host:port/context-path/base.path

api.path

String

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-openapi-java will calculate the absolute base path at runtime, which will be protocol://host:port/context-path/api.path So using relative paths is much easier. See above for an example.

api.version

String

The version of the api. Is default 0.0.0.

api.title

String

The title of the application.

api.description

String

A short description of the application.

api.termsOfService

String

A URL to the Terms of Service of the API.

api.contact.name

String

Name of person or organization to contact

api.contact.email

String

An email to be used for API-related correspondence.

api.contact.url

String

A URL to a website for more contact information.

api.license.name

String

The license name used for the API.

api.license.url

String

A URL to the license used for the API.

apiContextIdListing

boolean

Whether 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.

apiContextIdPattern

String

A 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

Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.