Hi.

I'm looking in to the possibility to do Contract First development with
Camel when the contract is a Swagger document. However I have been unable
to find any good resources on this subject. So before we run of and build
something I would like to check with the mailing list.

How do you do contract first REST development with Camel ? Is there any
tools out there  ?
I know about,  and have used, swagger codegen (for otrher frameworks). But
as it is now it does not seem to have support OOTB for Camel REST DSL.

What would be the preferred way to do this from the community ?

Personally I can see two ways to go.

A) Add support in swagger codegen for generating Camel REST DSL (as XML
and/or Java). The con of this option is that after generating code from
swagger the resulting implementation will never expose a swagger definition
that is exactly as the original. At least that is my experience from using
codegen for other frameworks.

B) Create a new Camel component that takes the Swagger definition file and
then acts as a dynamic router. It could be as simple as sending the message
to an direct endpoint based on the resource "operationId".
This new camel component could also expose a Swagger UI console based on
the original contract swagger definition instead of generating one from
REST DSL comments.
The con here is obviously that it would create yet another REST component
for camel.


// Pontus

Reply via email to