Not too long ago Claus Ibsen demo’ed the camel-swagger module. The camel-swagger module allows you to describe your Camel REST service using Swagger DSL. In this blogpost we converted his example to run on
Fabric8. After deploying the service to Kubernetes we can then import the API into the API Manager that is Apiman. Once imported the SwaggerJSON DSL is presented to API consumers in a nice viewer.
Obtaining and deploying the camel-swagger quickstarts
It is assumed you have a running Fabric8 instance running on Openshift 3 with Apiman deployed. Check this post if you don’t. Next, fork and clone the ipaas-quickstarts repository
git clone https://github.com/fabric8io/ipaas-quickstarts
To deploy the quickstart login to your Kubernetes master and invoke the f8-local-deploy profile running maven
oc login <your master> cd ipaas-quickstarts/quickstarts/cdi/camel-swagger mvn -Pf8-local-deploy
Show the camel-swagger API from the Apiman API Catalog
In the Fabric8 console look up the Apiman Application and find the link to the Apiman Console (look for
vagrant.f8 is your Kubernetes domain.
The catalog display all services running on Kubernetes and you can start an import into Apiman right from the catalog to make this service available as a
managed service. Also you can view the API description right from the Catalog.
The old Camel learned a new trick and can describe its RESTful service using SwaggerJSON. Apiman can import the SwaggerJSON DSL document and present service consumers with a central
API Catalog from where the service description can be viewed in the nice Swagger editor/viewer.