Questo contenuto non è disponibile nella lingua selezionata.

Chapter 336. Options


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

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita ilBlog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

© 2024 Red Hat, Inc.