Running Swagger UI with jQuery No-conflict
Swagger UI doesn't work in cases where jQuery is loaded in no-conflict mode - the $ references in swagger-ui.js cause $ is not a function errors. The same setup works when jQuery is loaded normally, but I can't rely on that.
I know that this can be worked around by enclosing the code in a self-executing function and passing in the jQuery object as $, but I'm hesitant to modify dependency code. My other option may be to try running Swagger UI in an iframe, where the parent page setup won't apply.
Please consider updating Swagger UI to work when jQuery is in no-conflict mode.
I would like to see this resolved as well. I did some digging and I believe the problem is in jquery-ba.bbq. We have a custom template that includes jquery 2.1. And that causes the Swagger UI to fail with this error. And jquery-ba.bbq appears to bot work with jquery 2.1 because of removed functions ($.param.fragment is not a function).
+1
I am working on this too. I want to be able to host this in an app that is using JQuery 2.x in noConflict mode.
The jquery-ba.bbq issue can be worked around by adding jQuery migrate. jQuery migrate will add back in the deprecated methods to support older dependencies like jquery-ba.bbq.
But, I am facing the same enclosure issue. I am going to go ahead and modify it, but +1 for wrapping everything in an enclosure.
This should be resolved in 3.0. Please reopen otherwise.
Good to know. I worked around the issue by using an iframe to contain the spec.