-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stuck at fetching resource list: http://localhost:9000/docs/swagger.json; Please wait. #101
Comments
Hmm, it's not obvious to me why you are getting that error from swagger ui. Do you want to click into that js error to see the code that throws the "cannot read property definitions of null"? |
I can't tell from this code where the error "the property definitions of null" comes from |
Yes the error is coming from swagger-ui.js. For more reference i have created a simple demo project to use swagger. Following is the link to the repository: https://github.com/SangeetaGulia/testSwagger and i am getting the same error in this code too when i try to hit the url to get swagger-ui. |
from your example, I noticed that you are using an old version of play swagger, would you mind update to the 0.4.0 first? No need for the PLAY2.5 suffix any more. |
Updated the version, but the same problem still persists :( |
Can you try with a minimum swagger base json? Keep only the required fields, like swagger version and host. |
I am going to setup an example project in the next couple of days. If you can wait that might help too. |
In the demo project : https://github.com/SangeetaGulia/testSwagger (this is the same project whose link i have mentioned earlier), I have used only : Is there anything which i am missing??? |
Actually i need to do it in next two days. You can use the demo project i have created, it may help me too to get the solution earlier. May be i am missing out something important. |
Hey, I just want to ask one more question is there any way to configure on what can be the location to store swagger.json? |
play-swagger reads swagger.json from resources. currently there is no way in play-swagger json to read from a location outside resources. I am glad that you resolved the issue. Thanks for the feedback! |
I am a newbie to swagger and i am stuck after doing the following things on an error:
I am using the following dependencies:
"com.iheart" %% "play-swagger" % "0.2.1-PLAY2.5",
"org.webjars" % "swagger-ui" % "2.1.4"
Following are the routes:
Following is the expected response type:
case class Output(response: JsValue)
This is the screenshot of where i am getting struck:
This is what i get in the auto generated json file(where it gets struck with error : fetching resource list):
{"paths":{"/assets/{file}":{"get":{"tags":["routes"],"parameters":[{"name":"path","type":"string","required":true,"in":"query"},{"name":"file","type":"asset","required":true,"in":"path"}]}},"/docs/swagger.json":{"get":{"tags":["routes"],"summary":"swagger definition","description":"for swagger UI to consume"}},"/client/view":{"get":{"tags":["routes"],"responses":{"200":{"description":"success","schema":{"$ref":"#/definitions/models.Output"}}}}}},"definitions":{"models.Output":{"properties":{"response":{"type":"play.api.libs.json.jsvalue","required":true}},"required":["response"]}},"tags":[{"name":"routes"}]}
and this is my default swagger.json file(which i have created) :
{
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "Weather API",
"description": "A sample API that uses a Mashape weather API as an example to demonstrate features in the swagger-2.0 specification",
"termsOfService": "http://helloreverb.com/terms/",
"contact": {
"name": "Tom Johnson",
"email": "tomjohnson1492@gmail.com",
"url": "localhost:9000"
},
"license": {
"name": "MIT",
"url": "http://opensource.org/licenses/MIT"
}
},
"host": "localhost:9000",
"basePath" : "localhost:9000",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/text"
]
}
The text was updated successfully, but these errors were encountered: