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

Fix TypeError with param type #458

Closed
wants to merge 1 commit into from
Closed

Conversation

rmarsch
Copy link

@rmarsch rmarsch commented Apr 28, 2014

using || operation with "" || undefined returns undefined. Should add an additional || to end the expression with a "" to protect against the value becoming undefined and breaking the .toLowerCase() call on line 79

using || operation with "" || undefined returns undefined. Should add an additional || to end the expression with a "" to protect against the value becoming undefined and breaking the .toLowerCase() call on line 79
@fehguy
Copy link
Contributor

fehguy commented Apr 29, 2014

That will make it more robust, but of course, something is quite wrong to get you in this position. There should always be a type value in the operation response for spec 1.2, and dataType for earlier versions.

@rmarsch
Copy link
Author

rmarsch commented Apr 29, 2014

True, however the JSON was produced by swagger-core running on annotations on source code. I did soon after fix the root cause. However when it was failing, swagger-ui just failed silently which seems like poor behavior requiring debugging of the javascript. Ideally somewhere along the way from the annotations there would either be an error/warning or it wouldn't fail silently.

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

Successfully merging this pull request may close these issues.

2 participants