blob: a942e1628a1b127ec2b2fe33ab4b88c577693b5c [file] [log] [blame]
== 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 swagger.io 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=http://petstore.swagger.io/v2/swagger.json \
--operation=getPetById \
--petId=9584
....
=== Help and contributions
If you hit any problem using Camel or have some feedback, then please
https://camel.apache.org/support.html[let us know].
We also love contributors, so
https://camel.apache.org/contributing.html[get involved] :-)
The Camel riders!