Giter Club home page Giter Club logo

Comments (12)

kailuowang avatar kailuowang commented on May 26, 2024

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"?

from play-swagger.

SangeetaGulia avatar SangeetaGulia commented on May 26, 2024

Heres the js statements which is throwing this error :
image

Can you please share the controllers code which you have mentioned in the documentation:
-> /api/cards cards.Routes
-> POST /users/:profileId/contexts/:contextName/cards controllers.api.Cards.createCard(profileId: Int, contextName: Option[String])

It will be very helpful.

from play-swagger.

kailuowang avatar kailuowang commented on May 26, 2024

I can't tell from this code where the error "the property definitions of null" comes from
in your screenshot it was swagger-ui.js?
The controller code doesn't matter (plus I don't have that code available). PlaySwagger doesn't try to parse controller.

from play-swagger.

SangeetaGulia avatar SangeetaGulia commented on May 26, 2024

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.
Any help will be appreciated.

from play-swagger.

kailuowang avatar kailuowang commented on May 26, 2024

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.

from play-swagger.

SangeetaGulia avatar SangeetaGulia commented on May 26, 2024

Updated the version, but the same problem still persists :(
Anything else that i need to do???

from play-swagger.

kailuowang avatar kailuowang commented on May 26, 2024

Can you try with a minimum swagger base json? Keep only the required fields, like swagger version and host.

from play-swagger.

kailuowang avatar kailuowang commented on May 26, 2024

I am going to setup an example project in the next couple of days. If you can wait that might help too.

from play-swagger.

SangeetaGulia avatar SangeetaGulia commented on May 26, 2024

In the demo project : https://github.com/SangeetaGulia/testSwagger (this is the same project whose link i have mentioned earlier),

I have used only :
{
"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",
},
"host": "localhost:9000",
"basePath": "/docs",
"schemes": [
"https",
"http"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
]
}
as minimum swagger base json.

Is there anything which i am missing???

from play-swagger.

SangeetaGulia avatar SangeetaGulia commented on May 26, 2024

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.

from play-swagger.

SangeetaGulia avatar SangeetaGulia commented on May 26, 2024

Hey,
The error is resolved. After putting swagger.json into conf folder of the project the problem is resolved.
Thanks for your help too.

I just want to ask one more question is there any way to configure on what can be the location to store swagger.json?

from play-swagger.

kailuowang avatar kailuowang commented on May 26, 2024

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!

from play-swagger.

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.