Skip to content
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

public/swagger/swagger-ui.js does not do a null check #1274

Closed
kktiwa opened this issue May 13, 2015 · 5 comments
Closed

public/swagger/swagger-ui.js does not do a null check #1274

kktiwa opened this issue May 13, 2015 · 5 comments

Comments

@kktiwa
Copy link

kktiwa commented May 13, 2015

There should be null check for 'definitions' without which the Swagger UI fails to load.

Line number 3468
Existing Code:

if (definitions[ref]) {
return new Model(ref, definitions[ref], this.models);

Code changed as fix:

if (definitions && definitions[ref]) {
return new Model(ref, definitions[ref], this.models, this.parent.modelPropertyMacro);

@fehguy
Copy link
Contributor

fehguy commented May 13, 2015

How are you getting definitions to be null?

@kktiwa
Copy link
Author

kktiwa commented May 14, 2015

I am using Swagger in a Play 2.3.7 project and had annotations over one of the REST APIs in my codebase.Inspite of the annotations being present,the swagger URL used to load with definitions being null.

@ponelat
Copy link
Member

ponelat commented May 28, 2015

more like undefined I think?
I've got it once or twice myself, with erroneous specs. However in the feature/yaml we're working on, I've made provision enforcing the spec to at least be an object. Which I believe is the root of this.

I can try to recreate this.

@webron
Copy link
Contributor

webron commented May 28, 2015

@kktiwa - can you share your Swagger definition to help us investigate it?

@webron
Copy link
Contributor

webron commented Jun 5, 2015

Closing due to lack of activity. Please reopen if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants