Code Monkey home page Code Monkey logo

Comments (8)

fehguy avatar fehguy commented on May 9, 2024

Hi, can you please use chrome and open the developer tools and let us know what the error message is in the console?

from swagger-ui.

angeloh avatar angeloh commented on May 9, 2024

Hi, this is the error messages from chrome developer tool.

Will try the following urls to discover api endpoints: swagger-service.js:27
http://localhost:9000/ swagger-service.js:27
http://localhost:9000 swagger-service.js:27
http://localhost:9000/resources.json swagger-service.js:27
http://localhost:9000/resources swagger-service.js:27
Trying url http://localhost:9000/ swagger-service.js:27
calling url http://bookmarklet.decide.com/bookmarklet/extension?url=http%3A%2F%2Flocalhost%3A4567%2F&callback=_decideBarCallback chrome-extension://nbojbfjmmakegikncmffodghebfbmcem/decide.js:259
XMLHttpRequest cannot load http://localhost:9000/. Origin http://localhost:4567 is not allowed by Access-Control-Allow-Origin.
Trying url http://localhost:9000 swagger-service.js:27
XMLHttpRequest cannot load http://localhost:9000/. Origin http://localhost:4567 is not allowed by Access-Control-Allow-Origin.
Trying url http://localhost:9000/resources.json swagger-service.js:27
Setting globalBasePath to http://localhost swagger-service.js:27
fetchResources: basePath = http://localhost swagger-service.js:27
resourceUrl: "http://localhost/register.json" swagger-service.js:27
Failed to load resource http://localhost/register.json
Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://bookmarklet.decide.com/bookmarklet/extension?url=http%3A%2F%2Flocalhost%3A4567%2F&callback=_decideBarCallback
12event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
Will try the following urls to discover api endpoints: swagger-service.js:27
http://localhost:9000/resources.json swagger-service.js:27
http://localhost:9000 swagger-service.js:27
http://localhost:9000/resources.json swagger-service.js:27
http://localhost:9000/resources swagger-service.js:27
Trying url http://localhost:9000/resources.json swagger-service.js:27
Setting globalBasePath to http://localhost swagger-service.js:27
fetchResources: basePath = http://localhost swagger-service.js:27
resourceUrl: "http://localhost/register.json" swagger-service.js:27
Failed to load resource

from swagger-ui.

fehguy avatar fehguy commented on May 9, 2024

looks like your base path is set to "http://localhost" but the server is running on port 9000. If you could paste the resources.json and register.json contents here, I think I can point to the issue. And what server framework are you using?

from swagger-ui.

angeloh avatar angeloh commented on May 9, 2024

These are the result I get from running Java Play 2 app with swagger.

http://localhost:9000/resources.json

{"apiVersion":"beta","swaggerVersion":"1.0","basePath":"http://localhost","apis":[{"path":"/register.{format}","description":"Operations about register"}]}

http://localhost:9000/register.json

{"apiVersion":"beta","swaggerVersion":"1.0","basePath":"http://localhost","resourcePath":"/register","apis":[{"path":"/register","description":"Operations about register","operations":[{"httpMethod":"POST","summary":"Add a new member to the store","responseClass":"ok","nickname":"registerByForm","parameters":[{"name":"devRegId","description":"device registration id for notification","paramType":"body","required":false,"allowMultiple":false,"dataType":"String"},{"name":"deviceId","description":"device GUID","paramType":"body","required":false,"allowMultiple":false,"dataType":"String"}],"errorResponses":[{"code":405,"reason":"Invalid input"}]}]}]}

from swagger-ui.

fehguy avatar fehguy commented on May 9, 2024

Looks like you need to set your base path in your application conf:

https://github.com/wordnik/swagger-core/blob/master/samples/java-play2/conf/application.conf#L59

It's trying to connect to the basePath of http://localhost but the resource is really on http://locahost:9000

from swagger-ui.

angeloh avatar angeloh commented on May 9, 2024

Yes, it works. But it might requires more manual works when deploying to production or staging.

from swagger-ui.

SangeetaGulia avatar SangeetaGulia commented on May 9, 2024

Hi,
I am facing similar problem. Stuck while fetching.

The json file is generated but on console, i am getting an error:
Uncaught TypeError: Cannot read property 'definitions' of null.............. pointing to
schema-markup.js file ---> if (schema.$ref) {

Also when i tried to use generated json file in swagger editor. I can see errors :
Missing required property: responses .... here i am using auto generated json file.
Refering to link : https://github.com/iheartradio/play-swagger

Any help would be appreciated.

from swagger-ui.

webron avatar webron commented on May 9, 2024

Well, opening a new ticket would help, and also providing the spec(s) that make you experience the issue(s). We can't do much without the specs.

from swagger-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.