camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Swagger not working
Date Fri, 05 Feb 2016 07:59:05 GMT
Can you try calling the api-doc with an ending slash?

And what version of Camel and ServiceMix are you using?

And have you installed camel-swagger-java in ServiceMix, you would
need to install that also?

On Fri, Feb 5, 2016 at 8:42 AM, Gohand <vio@ametiqconnect.com> wrote:
> Hi all
>
> I'm an absolute newbie to Camel, so please forgive me, if I'm not seeing an
> obvious solution.
>
> I tried using the Swagger component in combination with the Camel REST DSL
> in ServiceMix. My Spring XML looks as follows:
> <restConfiguration bindingMode="json" component="netty4-http"
> host="localhost" port="8080" contextPath="/api" apiContextPath="/api-doc"
> apiContextIdPattern="#name#">
>   <dataFormatProperty key="prettyPrint" value="true"/>
>   <apiProperty key="api.title" value="Issues API" />
>   <apiProperty key="api.version" value="1.0.0" />
>   <apiProperty key="cors" value="true" />
> </restConfiguration>
>
> A REST service looks like this:
> <rest path="/v1/issues">
>   <description>Issues rest service</description>
>   <get uri="/{id}" outType="xyz.Issue">
>     <description>Returns an single issue</description>
>
>     <to uri="direct:getSingle"/>
>   </get>
>   [...]
>
> The REST service itself works like a charm. I get the correct reply on
> hitting http://localhost:8080/api/v1/issues/123 for example.
>
> If I now try to get the Swagger JSON on http://localhost:8080/api-doc, the
> server replies with 404 - not found. There is no error when starting my
> bundle or calling the URL. In my opinion, the configuration is exactly as
> described in the video https://vimeo.com/140179426 by Claus Ibsen (except
> for using Spring XML instead of Java).
>
> Do you have an idea, why Swagger isn't working? Any help is highly
> appreciated.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Swagger-not-working-tp5777255.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

Mime
View raw message