// 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
You can use this extension to expose REST DSL services to Quarkus OpenAPI. With
`quarkus-smallrye-openapi`, you can access them by `/q/openapi?format=json`.

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

This is an experimental feature. You can enable it by
[source, properties]
----
quarkus.camel.openapi.expose.enabled=true
----

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

It doesn't support the rest services used in `org.apache.camel.builder.LambdaRouteBuilder` right now.
Also, it can not use CDI injection in the RouteBuilder `configure()` since we get the rest definitions at build time while CDI is unavailable.
====


[id="extensions-openapi-java-camel-quarkus-limitations"]
== Camel Quarkus limitations

The `apiContextIdListing` configuration option is not supported. Since multiple `CamelContext`s are not supported and Quarkus applications run standalone, there
is no scenario where attempting to resolve OpenApi specifications for a specific `CamelContext` would be useful. It also introduces some additional overhead of
requiring JMX (which is not supported in native mode) & additional Camel Quarkus extensions for processing XML.

