I am trying to integrate swagger with camel project
following this example https://github.com/smparekh/camel-example-servlet-rest-tomcat
How do i access swagger-ui using this example project ?
I delopyed the war file in tomcat.
and access http://localhost:8080/camel-example-servlet-rest-tomcat/api-docs i get this ...
{"apiVersion":"1.2.3","swaggerVersion":"1.2","apis":[{"path":"/user","description":"User rest service"}],"info":{"title":"User Services","description":"Camel Rest Example with Swagger that provides an User REST service"}}
BUT MY QUESTION IS - how do i access swagger-ui/index.html?
what is the exact URL to access swagger-UI?
These are your Swagger Docs:
Now you need Swagger-UI to consume them. You can install it anywhere. There is no hard requirement that you put Swagger-UI in your project. You just need to edit the
index.html
file to point to your docs path (the JSON output above.)You must copy the contents of the dist folder of swagger-ui into your project's webapp folder.
In index.html,
you must replace url with this
For details, Follow this link to integrate swagger-ui.
https://github.com/swagger-api/swagger-ui
You should use
http://localhost:${port}/${contextPath}/swagger/index.html
http://localhost:8080/camel-example-servlet-rest-tomcat/{basepath}/dist/index.html if you have copied dist folder as is. If you have renamed dist folder, use the new name instead of dist. replace basepath with basepath you have configured in web.xml. The code snippet for that looks like this:
To access swagger2 it is