Swagger-ui: Unable to Load Swagger UI

Created on 25 Jan 2013  路  7Comments  路  Source: swagger-api/swagger-ui

When I attempt to load my swagger api docs, I get the following error 0 : error http://localhost:8080/jersey-starterkit/rest/api-docs.json

When launching 'http://localhost:8080/jersey-starterkit/rest/api-docs.json' manually, the following is presented:

raw:

{"apiVersion":"1.0","apis":[{"description":"","path":"/api-docs.{format}/echo"},{"description":"","path":"/api-docs.{format}/hello"}],"basePath":"http://localhost:8080/jersey-starterkit/rest","swaggerVersion":"1.1"}

formatted:

{
    "apiVersion": "1.0",
    "apis": [{
        "description": "",
        "path": "/api-docs.{format}/echo"
    }, {
        "description": "",
        "path": "/api-docs.{format}/hello"
    }],
    "basePath": "http://localhost:8080/jersey-starterkit/rest",
    "swaggerVersion": "1.1"
}

I cannot determine if I setup swagger incorrectly.

Most helpful comment

@dinz19 facing same problem any fix??

All 7 comments

This looks fine--what happens if you hit this URL:

http://localhost:8080/jersey-starterkit/rest/api-docs.json/echo

That's what swagger-ui is looking for. You should open the chrome developer tools, select "network" and look to see if you're getting a 404 back from your server.

Thanks. I was able to access the endpoint http://localhost:8080/jersey-starterkit/rest/api-docs.json/echo successfully.

I had been running swagger-ui from the file system file:///code/swagger-ui-1.1.7/index.html but when I run from within my web container http://localhost:8080/swagger-ui-1.1.7/index.html everything works. I am not sure that I understand why this to be true, but issue resolved for me.

great--the issue is probably because of CORS in your browser, take a look at the troubleshooting section here:

https://github.com/wordnik/swagger-core/wiki/java-jax-rs

For more info about it.

GET http:// Server:8015/api/api-docs 404 (Not Found) @ client.js:841

index.html:106 Unable to Load SwaggerUI

But I can run this service in the browser :
http://server:8015/api/abc/def?date=20010203&format=json&compression=gzip and i can see the result in broser in json format.

I am not able to load SwaggerUI and I'm new to swagger UI. Can you please help me to resolve this?

@dinz19 facing same problem any fix??

@AbhinayThakur . Yes I got it fixed :) If you're still facing the issue with it, let me know

@dinz19 , I have the same issue "Unable to Load SwaggerUI"
Can you please help me to solve this?
What is the fix?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shockey picture shockey  路  34Comments

reginaldlouis picture reginaldlouis  路  43Comments

SzymonKlimuk picture SzymonKlimuk  路  32Comments

marlandy picture marlandy  路  53Comments

chanurahemal picture chanurahemal  路  87Comments