Comments (8)
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.
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.
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.
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.
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.
Yes, it works. But it might requires more manual works when deploying to production or staging.
from swagger-ui.
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.
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)
- Create a new option for urls.primaryName HOT 1
- SwaggerUI not render with Angular 13, when the build optimizer is AOT
- Schemas' content from `discriminator.mapping` are not displayed HOT 1
- Hide curl value for password or curl output itself?
- Sync SwaggerUI default options with Swagger-ui-react HOT 1
- Issue with runtime config default options HOT 1
- swagger-ui-react: regression in rendering HOT 2
- Adapt `swagger-ui-nextjs` to `next@14` HOT 1
- ANgular build require Path on build HOT 2
- Lib update leads to console error and fails to render HOT 4
- Latest Release Unable to Update HOT 6
- ` You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".` HOT 1
- Swagger-UI: OSGi manifest is missing starting from v5.15.2 HOT 1
- Regression between v5.15.2 and v5.16.0 when the configuration contains `filter: undefined` HOT 1
- swagger-ui-react onComplete is no longer called with a SwaggerUi instance HOT 1
- Default Value not getting assigned to the variable in generated typescript
- Can we add a component or a section to add buissness or technical error for the API ? HOT 2
- Failed to load API definition. Fetch error Failed to fetch https://petstore.swagger.io/v2/swagger.json
- Resolver error at requestBody.content.application/json.schema.$ref HOT 1
- Swagger UI 5.17.3 not visible on NPM HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swagger-ui.