// Do not edit directly!
// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
[id="extensions-openapi-java"]
= OpenAPI Java
:page-aliases: extensions/openapi-java.adoc
:linkattrs:
:cq-artifact-id: camel-quarkus-openapi-java
:cq-native-supported: true
:cq-status: Stable
:cq-status-deprecation: Stable
:cq-description: Expose OpenAPI resources defined in Camel REST DSL
:cq-deprecated: false
:cq-jvm-since: 1.0.0
:cq-native-since: 1.0.0

ifeval::[{doc-show-badges} == true]
[.badges]
[.badge-key]##JVM since##[.badge-supported]##1.0.0## [.badge-key]##Native since##[.badge-supported]##1.0.0##
endif::[]

Expose OpenAPI resources defined in Camel REST DSL

[id="extensions-openapi-java-whats-inside"]
== What's inside

* xref:{cq-camel-components}:others:openapi-java.adoc[Openapi Java]

Please refer to the above link for usage and configuration details.

[id="extensions-openapi-java-maven-coordinates"]
== Maven coordinates

https://{link-quarkus-code-generator}/?extension-search=camel-quarkus-openapi-java[Create a new project with this extension on {link-quarkus-code-generator}, window="_blank"]

Or add the coordinates to your existing project:

[source,xml]
----
<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-openapi-java</artifactId>
</dependency>
----
ifeval::[{doc-show-user-guide-link} == true]
Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
endif::[]

[id="extensions-openapi-java-usage"]
== Usage
[id="extensions-openapi-java-usage-swagger-ui-for-development"]
=== Swagger UI for development

This extension includes the https://quarkus.io/guides/openapi-swaggerui#dev-mode[Quarkus Swagger UI] for development.

Providing you set a configuration property `camel.rest.api-context-path` in `application.properties`, Camel REST DSL endpoints will automatically become available within the Swagger UI so that you can interact with them.

If you choose to expose Quarkus OpenAPI specifications alongside those from Camel, you can register them with the Swagger UI with configuration `quarkus.swagger-ui.urls."Quarkus"=/q/openapi`.

[id="extensions-openapi-java-usage-integration-with-quarkus-openapi"]
=== Integration with Quarkus OpenAPI

By default, Camel REST service OpenAPI specifications are exposed under a separate HTTP endpoint to those generated by Quarkus OpenAPI.

You can enable Camel REST services to be exposed on the Quarkus OpenAPI endpoint with the following configuration.

[source, properties]
----
quarkus.camel.openapi.expose.enabled=true
----

When `quarkus-smallrye-openapi` is added to the application dependencies, the OpenAPI specification can be accessed from the following path `/q/openapi?format=json`.

Refer to the https://quarkus.io/guides/openapi-swaggerui[Quarkus OpenAPI guide] for further information.

[WARNING]
====
It's the users responsibility to use `@RegisterForReflection` to register all model classes for reflection.

This feature does not support REST services defined by implementations of `org.apache.camel.builder.LambdaRouteBuilder`.

Usage of CDI injection within the RouteBuilder `configure()` method must also be avoided, since CDI is unavailable at build time.
====


[id="extensions-openapi-java-additional-camel-quarkus-configuration"]
== Additional Camel Quarkus configuration

[width="100%",cols="80,5,15",options="header"]
|===
| Configuration property | Type | Default


a|icon:lock[title=Fixed at build time] [[quarkus-camel-openapi-expose-enabled]]`link:#quarkus-camel-openapi-expose-enabled[quarkus.camel.openapi.expose.enabled]`

When set to true, Camel REST DSL OpenAPI specifications are exposed under the Quarkus OpenAPI HTTP endpoint
(`/q/openapi`). This requires `quarkus-smallrye-openapi` to be added to your application.
| `boolean`
| `false`
|===

[.configuration-legend]
{doc-link-icon-lock}[title=Fixed at build time] Configuration property fixed at build time. All other configuration properties are overridable at runtime.

