Search code examples
swaggerswagger-2.0swagger-codegen

How can I get Swagger to generate docs in html?


I've used swagger to write a restful API. When I run my server, it serves the API properly at X/, but it also is supposed to serve the documentation for the API at X/api-docs. It does so, but it presents the docs in JSON instead of HTML! I've been pouring through the documentation, trying to figure out how to get the docs in HTML, but I can't figure it out. (I generated my code using the Generate Server->Spring option.)


Solution

  • It turns out that I was going to localhost:8080/X/api-docs, but I needed to got to localhost:8080/X/swagger-ui.html. That's where the javadocs are.