Hi

Yeah option B could be nice, the rest component could be enhanced to
support this. And with a convention as you say with the "direct"
routes to map to some routes. Or allow users to configure the
context-path -> route id / url mappings.

You are welcome to log a JIRA about this idea.

For option A its outside Apache Camel to provide a swagger -> java
tool. Or to generate Camel XML routes. That is 3rd party tooling job
to do that.




On Tue, Nov 22, 2016 at 1:15 PM, Pontus Ullgren <ullg...@gmail.com> wrote:
> 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



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to