-
Notifications
You must be signed in to change notification settings - Fork 762
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
swagger.js: consumes/produces vars are leaked into global namespace #107
Comments
somehow the declaration for |
Shouldn't consumes/produces be instance vars for SwaggerResource? I assume https://github.com/wordnik/swagger-js/blob/master/lib/swagger.js#L1191 should have its own declaration of consumes/produces too. |
Yes, to both. It wasn't implemented at the top-level resource for swagger.js it appears. |
pls reopen if you're still seeing this |
We found the following issues while troubleshooting strongloop/loopback#432.
consumes
abdproduces
at https://github.com/wordnik/swagger-js/blob/master/lib/swagger.js#L324 are leaked into global namespace. As a result, the logic at https://github.com/wordnik/swagger-js/blob/master/lib/swagger.js#L1236 doesn't make sense.this.operation.consumes.indexOf(consumes) === -1
will always return -1 becauseconsumes
is an array. Theoperation.consumes
will be written into the globalconsumes
.consumes
, the default value is [] and it throws TypeError at https://github.com/wordnik/swagger-js/blob/master/lib/shred/content.js#L112.The text was updated successfully, but these errors were encountered: