added authorization support from swagger-js 2.0
This commit is contained in:
18
dist/lib/swagger.js
vendored
18
dist/lib/swagger.js
vendored
@@ -44,7 +44,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
SwaggerApi.prototype.build = function() {
|
SwaggerApi.prototype.build = function() {
|
||||||
var obj,
|
var e, obj,
|
||||||
_this = this;
|
_this = this;
|
||||||
this.progress('fetching resource list: ' + this.url);
|
this.progress('fetching resource list: ' + this.url);
|
||||||
console.log('getting ' + this.url);
|
console.log('getting ' + this.url);
|
||||||
@@ -112,6 +112,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
e = {};
|
||||||
|
if (typeof window !== 'undefined') {
|
||||||
|
e = window;
|
||||||
|
} else {
|
||||||
|
e = exports;
|
||||||
|
}
|
||||||
|
e.authorizations.apply(obj);
|
||||||
new SwaggerHttp().execute(obj);
|
new SwaggerHttp().execute(obj);
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
@@ -196,7 +203,7 @@
|
|||||||
SwaggerResource.prototype.consumes = null;
|
SwaggerResource.prototype.consumes = null;
|
||||||
|
|
||||||
function SwaggerResource(resourceObj, api) {
|
function SwaggerResource(resourceObj, api) {
|
||||||
var consumes, obj, parts, produces,
|
var consumes, e, obj, parts, produces,
|
||||||
_this = this;
|
_this = this;
|
||||||
this.api = api;
|
this.api = api;
|
||||||
this.api = this.api;
|
this.api = this.api;
|
||||||
@@ -233,6 +240,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
e = {};
|
||||||
|
if (typeof window !== 'undefined') {
|
||||||
|
e = window;
|
||||||
|
} else {
|
||||||
|
e = exports;
|
||||||
|
}
|
||||||
|
e.authorizations.apply(obj);
|
||||||
new SwaggerHttp().execute(obj);
|
new SwaggerHttp().execute(obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
8
dist/swagger-ui.js
vendored
8
dist/swagger-ui.js
vendored
@@ -1394,7 +1394,9 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
|
|||||||
_ref.clear();
|
_ref.clear();
|
||||||
}
|
}
|
||||||
this.headerView.update(this.options.url);
|
this.headerView.update(this.options.url);
|
||||||
return this.api = new SwaggerApi(this.options);
|
this.api = new SwaggerApi(this.options);
|
||||||
|
this.api.build();
|
||||||
|
return this.api;
|
||||||
};
|
};
|
||||||
|
|
||||||
SwaggerUi.prototype.render = function() {
|
SwaggerUi.prototype.render = function() {
|
||||||
@@ -1500,11 +1502,9 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
|
|||||||
trigger = false;
|
trigger = false;
|
||||||
}
|
}
|
||||||
$('#input_baseUrl').val(url);
|
$('#input_baseUrl').val(url);
|
||||||
$('#input_apiKey').val(apiKey);
|
|
||||||
if (trigger) {
|
if (trigger) {
|
||||||
return this.trigger('update-swagger-ui', {
|
return this.trigger('update-swagger-ui', {
|
||||||
url: url,
|
url: url
|
||||||
apiKey: apiKey
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
2
dist/swagger-ui.min.js
vendored
2
dist/swagger-ui.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -44,7 +44,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
SwaggerApi.prototype.build = function() {
|
SwaggerApi.prototype.build = function() {
|
||||||
var obj,
|
var e, obj,
|
||||||
_this = this;
|
_this = this;
|
||||||
this.progress('fetching resource list: ' + this.url);
|
this.progress('fetching resource list: ' + this.url);
|
||||||
console.log('getting ' + this.url);
|
console.log('getting ' + this.url);
|
||||||
@@ -112,6 +112,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
e = {};
|
||||||
|
if (typeof window !== 'undefined') {
|
||||||
|
e = window;
|
||||||
|
} else {
|
||||||
|
e = exports;
|
||||||
|
}
|
||||||
|
e.authorizations.apply(obj);
|
||||||
new SwaggerHttp().execute(obj);
|
new SwaggerHttp().execute(obj);
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
@@ -196,7 +203,7 @@
|
|||||||
SwaggerResource.prototype.consumes = null;
|
SwaggerResource.prototype.consumes = null;
|
||||||
|
|
||||||
function SwaggerResource(resourceObj, api) {
|
function SwaggerResource(resourceObj, api) {
|
||||||
var consumes, obj, parts, produces,
|
var consumes, e, obj, parts, produces,
|
||||||
_this = this;
|
_this = this;
|
||||||
this.api = api;
|
this.api = api;
|
||||||
this.api = this.api;
|
this.api = this.api;
|
||||||
@@ -233,6 +240,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
e = {};
|
||||||
|
if (typeof window !== 'undefined') {
|
||||||
|
e = window;
|
||||||
|
} else {
|
||||||
|
e = exports;
|
||||||
|
}
|
||||||
|
e.authorizations.apply(obj);
|
||||||
new SwaggerHttp().execute(obj);
|
new SwaggerHttp().execute(obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ class SwaggerUi extends Backbone.Router
|
|||||||
@mainView?.clear()
|
@mainView?.clear()
|
||||||
@headerView.update(@options.url)
|
@headerView.update(@options.url)
|
||||||
@api = new SwaggerApi(@options)
|
@api = new SwaggerApi(@options)
|
||||||
|
@api.build()
|
||||||
|
@api
|
||||||
|
|
||||||
# This is bound to success handler for SwaggerApi
|
# This is bound to success handler for SwaggerApi
|
||||||
# so it gets called when SwaggerApi completes loading
|
# so it gets called when SwaggerApi completes loading
|
||||||
|
|||||||
@@ -33,5 +33,5 @@ class HeaderView extends Backbone.View
|
|||||||
|
|
||||||
update: (url, apiKey, trigger = false) ->
|
update: (url, apiKey, trigger = false) ->
|
||||||
$('#input_baseUrl').val url
|
$('#input_baseUrl').val url
|
||||||
$('#input_apiKey').val apiKey
|
#$('#input_apiKey').val apiKey
|
||||||
@trigger 'update-swagger-ui', {url:url, apiKey:apiKey} if trigger
|
@trigger 'update-swagger-ui', {url:url} if trigger
|
||||||
|
|||||||
Reference in New Issue
Block a user