You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by idioma <co...@gmail.com> on 2016/10/05 16:23:22 UTC

Swagger validation with camel-swagger

Hi,
I have been experimenting with:

https://github.com/apache/camel/tree/master/examples/camel-example-swagger-xml

as I would like to define my rest endpoints with Camel Rest DSL and generate
my swagger API doc with camel-swagger-java. 

As per https://issues.apache.org/jira/browse/CAMEL-10164, I read "Then
because of the swagger api we are able to validate and know if the payload
is validate before calling the service." What does it expressely mean? Does
it mean that I can somehow validate the swagger API as generated by the Java
code? How do I do that?

Thank you,

I.



--
View this message in context: http://camel.465427.n5.nabble.com/Swagger-validation-with-camel-swagger-tp5788403.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Swagger validation with camel-swagger

Posted by idioma <co...@gmail.com>.
Hi,
thanks for your reply. I am not sure what you mean by "the issue has been
fixed". Do you mean that the current camel-swagger-java component does not
allow swagger validation? 

Thank you,

Ilaria



--
View this message in context: http://camel.465427.n5.nabble.com/Swagger-validation-with-camel-swagger-tp5788403p5788431.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Swagger validation with camel-swagger

Posted by fabryprog <fa...@bizmate.it>.
Hello, this issue been fixed into 2.18.0 that will be releases within few
days



--
View this message in context: http://camel.465427.n5.nabble.com/Swagger-validation-with-camel-swagger-tp5788403p5788424.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Swagger validation with camel-swagger

Posted by idioma <co...@gmail.com>.
Claus,
thank you so much for your reply, it is very much clear now. 

Have a good day,

I.



--
View this message in context: http://camel.465427.n5.nabble.com/Swagger-validation-with-camel-swagger-tp5788403p5788559.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Swagger validation with camel-swagger

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

So Camel provides a rest-dsl which allows to expose RESTful services in Camel.
http://camel.apache.org/rest-dsl

When doing this you can also enable swagger api-doc as documentation
for your RESTful services.

This is only for expose RESTful services inside Camel. If you want to
call existing REST services from Camel then you need to use some of
the REST component like camel-cxf / restlet etc. (not rest-dsl).

Now in Camel 2.18 we have a new rest component you can configure with
a swagger api, and then it will validate that the message you are
about to send from Camel to the existing REST service is valid
according to the swagger doc. It can also do some pre-validation at
startup as well and therefore make Camel fail faster.

There is no example of the latter, you can find some unit tests however.


On Wed, Oct 5, 2016 at 12:23 PM, idioma <co...@gmail.com> wrote:
> Hi,
> I have been experimenting with:
>
> https://github.com/apache/camel/tree/master/examples/camel-example-swagger-xml
>
> as I would like to define my rest endpoints with Camel Rest DSL and generate
> my swagger API doc with camel-swagger-java.
>
> As per https://issues.apache.org/jira/browse/CAMEL-10164, I read "Then
> because of the swagger api we are able to validate and know if the payload
> is validate before calling the service." What does it expressely mean? Does
> it mean that I can somehow validate the swagger API as generated by the Java
> code? How do I do that?
>
> Thank you,
>
> I.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Swagger-validation-with-camel-swagger-tp5788403.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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