tree: 1e98546c0db5c412e4cd3ca2471a7a44b77d5d4e [path history] [tgz]
  1. src/
  2. pom.xml

Camel Rest Swagger example

This example shows how to call a REST service defined using Swagger specification with the help of Camel Rest Swagger component.

The example is a standalong Spring Boot application that acts as a REST client, you can run simply by issuing:

$ mvn spring-boot:run

Or by packaging it and running it using java CLI:

$ mvn package
$ java -jar target/camel-example-rest-swagger-*.jar

The example by default uses the PetStore demo hosted on and invokes the getInventory operation. You can make it call any API that you have Swagger specification for and any operation with simple arguments, for instance this retrives a pet from the PetStore demo with ID 9584:

$ java -jar target/camel-example-rest-swagger-*.jar \
    --swagger= \
    --operation=getPetById \

More information

You can find more information about Apache Camel at the website: