REST OpenApi

JVM since1.0.0 Native since1.0.0

To call REST services using OpenAPI specification as contract.

What’s inside

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

Maven coordinates

Or add the coordinates to your existing project:


Check the User guide for more information about writing Camel Quarkus applications.


Required Dependencies

A RestProducerFactory implementation must be available when using the rest-openapi extension. The currently known extensions are:

  • camel-quarkus-http

  • camel-quarkus-netty-http

Maven users will need to add one of these dependencies to their pom.xml, for example:


Depending on which mechanism is used to load the OpenApi specification, additional dependencies may be required. When using the file resource locator, the org.apache.camel.quarkus:camel-quarkus-file extension must be added as a project dependency. When using ref or bean to load the specification, not only must the org.apache.camel.quarkus:camel-quarkus-bean dependency be added, but the bean itself must be annotated with @RegisterForReflection.

When using the classpath resource locator with native code, the path to the OpenAPI specification must be specified in the quarkus.native.resources.includes property of the file. For example:


Contract First Development

The model classes generation has been integrated with the quarkus-maven-plugin. So there’s no need to use the swagger-codegen-maven-plugin, instead put your contract files in src/main/openapi with a .json suffix. And add the generate-code goal to the quarkus-maven-plugin like:


It requires a specific package name for the model classes by using the quarkus.camel.openapi.codegen.model-package property of the file. For example:


This package name should be added in as well.

The contract files in src/main/openapi needs to be added in the classpath since they could be used in Camel Rest DSL. So you can add src/main/openapi in pom.xml


When running in the native mode, the contract files must be specified the quarkus.native.resources.include like


Additional Camel Quarkus configuration

Configuration property Type Default


If true, Camel Quarkus OpenAPI code generation is run for .json files discovered from the openapi directory. When false, code generation for .json files is disabled.




The package to use for generated model classes.




A comma separated list of models to generate. All models is the default.



If true, use bean validation annotations in the generated model classes.




If true, use NON_NULL Jackson annotation in the generated model classes.



Configuration property fixed at build time. All other configuration properties are overridable at runtime.