Domanda

I am currently battling a swagger configuration for my spring MVC RESTful services project. I decided to follow the swagger-spring but I fail to understand if the UI part of swagger should be a totally different project or should it reside in the same context on the container?

The swagger json from my spring mvc based RESTFul services is showing up correctly on a link like: http://<server>:<port>/<context>/api-docs but whenever I put in the swagger UI components in the application(JSP, CSS and JS files), I cannot access the swagger UI, which should look like this.

È stato utile?

Soluzione

You need to update index.html that came with swagger-ui. Update below line to your webapp URL.

url: "http://petstore.swagger.wordnik.com/api/api-docs",

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top