Skip to content

Commit 775b021

Browse files
committed
Possible fix for #96
1 parent 6324cc9 commit 775b021

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/swagger.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ var SwaggerApi = function(url, options) {
8787
this.authorizations = null;
8888
this.authorizationScheme = null;
8989
this.info = null;
90+
this.useJQuery = false;
9091

9192
options = (options||{});
9293
if (url)
@@ -103,6 +104,9 @@ var SwaggerApi = function(url, options) {
103104
if (options.success != null)
104105
this.success = options.success;
105106

107+
if (typeof options.useJQuery === 'boolean')
108+
this.useJQuery = options.useJQuery;
109+
106110
this.failure = options.failure != null ? options.failure : function() {};
107111
this.progress = options.progress != null ? options.progress : function() {};
108112
if (options.success != null)
@@ -1072,7 +1076,7 @@ SwaggerOperation.prototype.formatXml = function(xml) {
10721076
var SwaggerRequest = function(type, url, params, opts, successCallback, errorCallback, operation, execution) {
10731077
var _this = this;
10741078
var errors = [];
1075-
this.useJQuery = (typeof operation.useJQuery !== 'undefined' ? operation.useJQuery : null);
1079+
this.useJQuery = (typeof operation.resource.useJQuery !== 'undefined' ? operation.resource.useJQuery : null);
10761080
this.type = (type||errors.push("SwaggerRequest type is required (get/post/put/delete/patch/options)."));
10771081
this.url = (url||errors.push("SwaggerRequest url is required."));
10781082
this.params = params;

0 commit comments

Comments
 (0)