Reputation: 81
When I am using localhost in SwaggerUIBundle URL it works fine and does not show error button
SwaggerUIBundle({ url: "http://localhost:9001/api/docs/data" });
but when I use IP address instead of localhost, error button appear on the page and clicking on error button getting this message.
{"schemaValidationMessages":[ { "level":"error", "message":"Can't read from file http://10.100.160.420:9001/api/docs/swagger.json" } ]}
I don't want to use validatorUrl: null, Please don't answer to use this validatorUrl: null. I just want to know why it is not working with IP address but working with localhost ?
Upvotes: 2
Views: 1834
Reputation: 97609
I don't want to use validatorUrl: null, Please don't answer to use this validatorUrl: null. I just want to know why it is not working with IP address but working with localhost ?
Swagger UI does not display the validator badge in the following cases:
validatorUrl: null
configuration option is specifiedlocalhost
or 127.0.0.1
That's why the validator badge does not appear if you use http://localhost/...
but appears if you use http://10.100.160.420:9001/...
.
Upvotes: 4