camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gohand <...@ametiqconnect.com>
Subject Swagger not working
Date Fri, 05 Feb 2016 07:42:49 GMT
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.

Mime
View raw message