When I hit http://localhost:3001/api-docs loads the swagger json docs.
{
swagger: "2.0",
info: {
version: "1.0.0",
title: "Auth-gateway services",
contact: {
name: "swagger docs",
url: "https://www.google.com"
}
},
host: "127.0.0.1:3001",
basePath: "/",
...
}
But how do I load UI like http://petstore.swagger.io/ for my APIs.
To view you api through swagger-ui, do one of the following.
Option 1: Using online swagger-ui
Option 2: Setting up swagger-ui project locally
You have to set up swagger-ui. You can clone the project set up that with the below instructions provided.
Now you should be able to see something exactly like online swagger-ui.
Do the same as option 1 to provide swagger-json url and see swagger-ui generated.