updated with master

This commit is contained in:
Tony Tam
2017-01-02 14:03:25 -07:00
12 changed files with 257 additions and 18612 deletions

18660
dist/swagger-ui.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -122,6 +122,17 @@ function handleLogin() {
//(needs to be aware of schemes to do so correctly) //(needs to be aware of schemes to do so correctly)
window.enabledScopes=scopes; window.enabledScopes=scopes;
/**
* Returns the name of the access token parameter returned by the server.
*
* @param dets
* The authorisation scheme configuration.
* @return the name of the access token parameter
*/
function getTokenName(dets) {
return dets.vendorExtensions['x-tokenName'] || dets.tokenName;
}
for (var key in authSchemes) { for (var key in authSchemes) {
if (authSchemes.hasOwnProperty(key) && OAuthSchemeKeys.indexOf(key) != -1) { //only look at keys that match this scope. if (authSchemes.hasOwnProperty(key) && OAuthSchemeKeys.indexOf(key) != -1) { //only look at keys that match this scope.
var flow = authSchemes[key].flow; var flow = authSchemes[key].flow;
@@ -129,13 +140,13 @@ function handleLogin() {
if(authSchemes[key].type === 'oauth2' && flow && (flow === 'implicit' || flow === 'accessCode')) { if(authSchemes[key].type === 'oauth2' && flow && (flow === 'implicit' || flow === 'accessCode')) {
var dets = authSchemes[key]; var dets = authSchemes[key];
url = dets.authorizationUrl + '?response_type=' + (flow === 'implicit' ? 'token' : 'code'); url = dets.authorizationUrl + '?response_type=' + (flow === 'implicit' ? 'token' : 'code');
window.swaggerUi.tokenName = dets.tokenName || 'access_token'; window.swaggerUi.tokenName = getTokenName(dets) || 'access_token';
window.swaggerUi.tokenUrl = (flow === 'accessCode' ? dets.tokenUrl : null); window.swaggerUi.tokenUrl = (flow === 'accessCode' ? dets.tokenUrl : null);
state = key; state = key;
} }
else if(authSchemes[key].type === 'oauth2' && flow && (flow === 'application')) { else if(authSchemes[key].type === 'oauth2' && flow && (flow === 'application')) {
var dets = authSchemes[key]; var dets = authSchemes[key];
window.swaggerUi.tokenName = dets.tokenName || 'access_token'; window.swaggerUi.tokenName = getTokenName(dets) || 'access_token';
clientCredentialsFlow(scopes, dets.tokenUrl, key); clientCredentialsFlow(scopes, dets.tokenUrl, key);
return; return;
} }
@@ -147,13 +158,13 @@ function handleLogin() {
var dets = o[t]; var dets = o[t];
var ep = dets.loginEndpoint.url; var ep = dets.loginEndpoint.url;
url = dets.loginEndpoint.url + '?response_type=token'; url = dets.loginEndpoint.url + '?response_type=token';
window.swaggerUi.tokenName = dets.tokenName; window.swaggerUi.tokenName = getTokenName(dets);
} }
else if (o.hasOwnProperty(t) && t === 'accessCode') { else if (o.hasOwnProperty(t) && t === 'accessCode') {
var dets = o[t]; var dets = o[t];
var ep = dets.tokenRequestEndpoint.url; var ep = dets.tokenRequestEndpoint.url;
url = dets.tokenRequestEndpoint.url + '?response_type=code'; url = dets.tokenRequestEndpoint.url + '?response_type=code';
window.swaggerUi.tokenName = dets.tokenName; window.swaggerUi.tokenName = getTokenName(dets);
} }
} }
} }

View File

@@ -2,6 +2,7 @@
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="x-ua-compatible" content="IE=edge">
<title>Swagger UI</title> <title>Swagger UI</title>
<link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32" /> <link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16" /> <link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16" />
@@ -74,7 +75,8 @@
docExpansion: "none", docExpansion: "none",
jsonEditor: false, jsonEditor: false,
defaultModelRendering: 'schema', defaultModelRendering: 'schema',
showRequestHeaders: false showRequestHeaders: false,
showOperationIds: false
}); });
window.swaggerUi.load(); window.swaggerUi.load();

View File

@@ -109,22 +109,33 @@ SwaggerUi.Views.AuthView = Backbone.View.extend({
window.enabledScopes = scopes; window.enabledScopes = scopes;
var flow = auth.get('flow'); var flow = auth.get('flow');
/**
* Returns the name of the access token parameter returned by the server.
*
* @param dets
* The authorisation scheme configuration.
* @return the name of the access token parameter
*/
function getTokenName(dets) {
return dets.vendorExtensions['x-tokenName'] || dets.tokenName;
}
if(auth.get('type') === 'oauth2' && flow && (flow === 'implicit' || flow === 'accessCode')) { if(auth.get('type') === 'oauth2' && flow && (flow === 'implicit' || flow === 'accessCode')) {
dets = auth.attributes; dets = auth.attributes;
url = dets.authorizationUrl + '?response_type=' + (flow === 'implicit' ? 'token' : 'code'); url = dets.authorizationUrl + '?response_type=' + (flow === 'implicit' ? 'token' : 'code');
container.tokenName = dets.tokenName || 'access_token'; container.tokenName = getTokenName(dets) || 'access_token';
container.tokenUrl = (flow === 'accessCode' ? dets.tokenUrl : null); container.tokenUrl = (flow === 'accessCode' ? dets.tokenUrl : null);
state = container.OAuthSchemeKey; state = container.OAuthSchemeKey;
} }
else if(auth.get('type') === 'oauth2' && flow && (flow === 'application')) { else if(auth.get('type') === 'oauth2' && flow && (flow === 'application')) {
dets = auth.attributes; dets = auth.attributes;
container.tokenName = dets.tokenName || 'access_token'; container.tokenName = getTokenName(dets) || 'access_token';
this.clientCredentialsFlow(scopes, dets, container.OAuthSchemeKey); this.clientCredentialsFlow(scopes, dets, container.OAuthSchemeKey);
return; return;
} }
else if(auth.get('type') === 'oauth2' && flow && (flow === 'password')) { else if(auth.get('type') === 'oauth2' && flow && (flow === 'password')) {
dets = auth.attributes; dets = auth.attributes;
container.tokenName = dets.tokenName || 'access_token'; container.tokenName = getTokenName(dets) || 'access_token';
this.passwordFlow(scopes, dets, container.OAuthSchemeKey); this.passwordFlow(scopes, dets, container.OAuthSchemeKey);
return; return;
} }
@@ -136,13 +147,13 @@ SwaggerUi.Views.AuthView = Backbone.View.extend({
dets = o[t]; dets = o[t];
ep = dets.loginEndpoint.url; ep = dets.loginEndpoint.url;
url = dets.loginEndpoint.url + '?response_type=token'; url = dets.loginEndpoint.url + '?response_type=token';
container.tokenName = dets.tokenName; container.tokenName = getTokenName(dets);
} }
else if (o.hasOwnProperty(t) && t === 'accessCode') { else if (o.hasOwnProperty(t) && t === 'accessCode') {
dets = o[t]; dets = o[t];
ep = dets.tokenRequestEndpoint.url; ep = dets.tokenRequestEndpoint.url;
url = dets.tokenRequestEndpoint.url + '?response_type=code'; url = dets.tokenRequestEndpoint.url + '?response_type=code';
container.tokenName = dets.tokenName; container.tokenName = getTokenName(dets);
} }
} }
} }

View File

@@ -111,7 +111,7 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
addResource: function(resource, auths){ addResource: function(resource, auths){
// Render a resource and add it to resources li // Render a resource and add it to resources li
resource.id = resource.id.replace(/\s/g, '_'); resource.id = resource.id.replace(/[[\]{}()*+?,\\/^$|#\s]/g, '_');
// Make all definitions available at the root of the resource so that they can // Make all definitions available at the root of the resource so that they can
// be loaded by the JSonEditor // be loaded by the JSonEditor

View File

@@ -27,6 +27,10 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
if (opts.swaggerOptions.showRequestHeaders) { if (opts.swaggerOptions.showRequestHeaders) {
this.model.showRequestHeaders = true; this.model.showRequestHeaders = true;
} }
if (opts.swaggerOptions.showOperationIds) {
this.model.showOperationIds = true;
}
} }
return this; return this;
}, },
@@ -683,6 +687,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
var pre; var pre;
var code; var code;
var skipHighlight = false;
if (!content) { if (!content) {
code = $('<code />').text('no content'); code = $('<code />').text('no content');
pre = $('<pre class="json" />').append(code); pre = $('<pre class="json" />').append(code);
@@ -717,6 +722,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
var responseFilename = /filename=([^;]*);?/.exec(disposition); var responseFilename = /filename=([^;]*);?/.exec(disposition);
if(responseFilename !== null && responseFilename.length > 1) { if(responseFilename !== null && responseFilename.length > 1) {
download = responseFilename[1]; download = responseFilename[1];
fileName = download;
} }
} }
@@ -725,6 +731,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
a.innerText = 'Download ' + fileName; a.innerText = 'Download ' + fileName;
pre = $('<div/>').append(a); pre = $('<div/>').append(a);
skipHighlight = true;
} else { } else {
pre = $('<pre class="json" />').append('Download headers detected but your browser does not support downloading binary via XHR (Blob).'); pre = $('<pre class="json" />').append('Download headers detected but your browser does not support downloading binary via XHR (Blob).');
} }
@@ -798,9 +805,14 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
$('.request_headers', $(this.el)).html('<pre>' + _.escape(JSON.stringify(requestHeaders, null, ' ')).replace(/\n/g, '<br>') + '</pre>'); $('.request_headers', $(this.el)).html('<pre>' + _.escape(JSON.stringify(requestHeaders, null, ' ')).replace(/\n/g, '<br>') + '</pre>');
} }
// Call user-defined hook
if (opts.responseHooks && opts.responseHooks[this.nickname]) {
opts.responseHooks[this.nickname](response, this);
}
var response_body_el = $('.response_body', $(this.el))[0]; var response_body_el = $('.response_body', $(this.el))[0];
// only highlight the response if response is less than threshold, default state is highlight response // only highlight the response if response is less than threshold, default state is highlight response
if (opts.highlightSizeThreshold && typeof response.data !== 'undefined' && response.data.length > opts.highlightSizeThreshold) { if (opts.highlightSizeThreshold && typeof response.data !== 'undefined' && response.data.length > opts.highlightSizeThreshold || skipHighlight) {
return response_body_el; return response_body_el;
} else { } else {
return hljs.highlightBlock(response_body_el); return hljs.highlightBlock(response_body_el);

View File

@@ -689,7 +689,8 @@ SwaggerUi.partials.signature = (function () {
return str.join(''); return str.join('');
}; };
var getName = function (name, xml) { // Commenting this funtion as the names are now determined beforehand and the prefix part is exposed as a separate function | https://github.com/swagger-api/swagger-ui/issues/2577
/** var getName = function (name, xml) {
var result = name || ''; var result = name || '';
xml = xml || {}; xml = xml || {};
@@ -704,6 +705,19 @@ SwaggerUi.partials.signature = (function () {
return result; return result;
}; };
*/
var getPrefix = function (name, xml) {
var result = name || '';
xml = xml || {};
if (xml.prefix) {
result = xml.prefix + ':' + result;
}
return result;
};
var getNamespace = function (xml) { var getNamespace = function (xml) {
var namespace = ''; var namespace = '';
@@ -739,9 +753,12 @@ SwaggerUi.partials.signature = (function () {
var attributes = []; var attributes = [];
if (!items) { return getErrorMessage(); } if (!items) { return getErrorMessage(); }
var key = name;
value = createSchemaXML(name, items, models, config); // If there is a name specified for the array elements, use that for the array elements name | https://github.com/swagger-api/swagger-ui/issues/2577
if(items.xml && items.xml.name) {
key = items.xml.name;
}
value = createSchemaXML(key, items, models, config);
if (namespace) { if (namespace) {
attributes.push(namespace); attributes.push(namespace);
} }
@@ -872,6 +889,7 @@ SwaggerUi.partials.signature = (function () {
var output, index; var output, index;
config = config || {}; config = config || {};
config.modelsToIgnore = config.modelsToIgnore || []; config.modelsToIgnore = config.modelsToIgnore || [];
var descriptor = _.isString($ref) ? getDescriptorByRef($ref, name, models, config) var descriptor = _.isString($ref) ? getDescriptorByRef($ref, name, models, config)
: getDescriptor(name, definition, models, config); : getDescriptor(name, definition, models, config);
@@ -904,10 +922,10 @@ SwaggerUi.partials.signature = (function () {
if (arguments.length < 4) { if (arguments.length < 4) {
throw new Error(); throw new Error();
} }
this.config = config || {}; this.config = config || {};
this.config.modelsToIgnore = this.config.modelsToIgnore || []; this.config.modelsToIgnore = this.config.modelsToIgnore || [];
this.name = getName(name, definition.xml); // name is already set by getDescriptorByRef or getDescriptor function depending on the type. Only prefix, if present is needed to be set here | https://github.com/swagger-api/swagger-ui/issues/2577
this.name = getPrefix(name, definition.xml);
this.definition = definition; this.definition = definition;
this.models = models; this.models = models;
this.type = type; this.type = type;
@@ -917,7 +935,14 @@ SwaggerUi.partials.signature = (function () {
var modelType = simpleRef($ref); var modelType = simpleRef($ref);
var model = models[modelType] || {}; var model = models[modelType] || {};
var type = model.definition && model.definition.type ? model.definition.type : 'object'; var type = model.definition && model.definition.type ? model.definition.type : 'object';
name = name || model.name; // If model definition xml name is present, then that will be preferred over model name. This is the case of preferring XmlElement name over XmlRootElement name if XmlElement name is provided | https://github.com/swagger-api/swagger-ui/issues/2577
if(model.definition && model.definition.xml && model.definition.xml.name) {
name = name || model.definition.xml.name || model.name;
}
// else only model name will be considered for determination | https://github.com/swagger-api/swagger-ui/issues/2577
else {
name = name || model.name;
}
if (config.modelsToIgnore.indexOf($ref) > -1) { if (config.modelsToIgnore.indexOf($ref) > -1) {
type = 'loop'; type = 'loop';
@@ -929,13 +954,15 @@ SwaggerUi.partials.signature = (function () {
if (!model.definition) { if (!model.definition) {
return null; return null;
} }
return new Descriptor(name, type, model.definition, models, config); return new Descriptor(name, type, model.definition, models, config);
} }
function getDescriptor (name, definition, models, config){ function getDescriptor (name, definition, models, config){
var type = definition.type || 'object'; var type = definition.type || 'object';
// If definition xml name is present, then that will be preferred over name | https://github.com/swagger-api/swagger-ui/issues/2577
if(definition.xml && definition.xml.name) {
name = definition.xml.name || name;
}
if (!definition) { if (!definition) {
return null; return null;
} }

View File

@@ -250,7 +250,8 @@
font-size: .85em; font-size: .85em;
line-height: 1.2em; line-height: 1.2em;
overflow: auto; overflow: auto;
max-height: 200px; height: 200px;
resize: vertical;
cursor: pointer; cursor: pointer;
} }
ul.signature-nav { ul.signature-nav {
@@ -708,6 +709,11 @@
padding: 0; padding: 0;
line-height: inherit; line-height: inherit;
} }
.nickname {
color: #aaaaaa;
padding: 0;
line-height: inherit;
}
} }
} }
} }

View File

@@ -10,6 +10,11 @@
</span> </span>
</h3> </h3>
<ul class='options'> <ul class='options'>
{{#if showOperationIds}}
<li>
<a href='#!/{{sanitize encodedParentId}}/{{sanitize nickname}}' class="toggleOperation"><span class="nickname">{{{escape nickname}}}()</span></a>
</li>
{{/if}}
<li> <li>
<a href='#!/{{sanitize encodedParentId}}/{{sanitize nickname}}' class="toggleOperation"><span class="markdown">{{{escape summary}}}</span></a> <a href='#!/{{sanitize encodedParentId}}/{{sanitize nickname}}' class="toggleOperation"><span class="markdown">{{{escape summary}}}</span></a>
</li> </li>

View File

@@ -18,7 +18,7 @@
{{/if}} {{/if}}
{{else}} {{else}}
{{#if isFile}} {{#if isFile}}
<input class='parameter' class='required' type='file' name='{{{sanitize name}}}' id='{{{escape valueId}}}'/> <input class='parameter required' type='file' name='{{{sanitize name}}}' id='{{{escape valueId}}}'/>
{{else}} {{else}}
{{#renderTextParam this}} {{#renderTextParam this}}
{{/renderTextParam}} {{/renderTextParam}}

View File

@@ -212,6 +212,28 @@ templates['main'] = template({"1":function(container,depth0,helpers,partials,dat
+ " </h4>\n </div>\n</div>\n"; + " </h4>\n </div>\n</div>\n";
},"useData":true}); },"useData":true});
templates['oauth2'] = template({"1":function(container,depth0,helpers,partials,data) { templates['oauth2'] = template({"1":function(container,depth0,helpers,partials,data) {
var stack1;
return "<p>Authorization URL: "
+ ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.authorizationUrl : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
+ "</p>";
},"3":function(container,depth0,helpers,partials,data) {
var stack1;
return "<p>Token URL: "
+ ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.tokenUrl : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
+ "</p>";
},"5":function(container,depth0,helpers,partials,data) {
return " <p>Please input username and password for password flow authorization</p>\n <fieldset>\n <div><label>Username: <input class=\"oauth-username\" type=\"text\" name=\"username\"></label></div>\n <div><label>Password: <input class=\"oauth-password\" type=\"password\" name=\"password\"></label></div>\n </fieldset>\n";
},"7":function(container,depth0,helpers,partials,data) {
var stack1;
return " <p>Setup client authentication."
+ ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.requireClientAuthenticaiton : depth0),{"name":"if","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "</p>\n <fieldset>\n <div><label>Type:\n <select class=\"oauth-client-authentication-type\" name=\"client-authentication-type\">\n <option value=\"none\" selected>None or other</option>\n <option value=\"basic\">Basic auth</option>\n <option value=\"request-body\">Request body</option>\n </select>\n </label></div>\n <div class=\"oauth-client-authentication\" hidden>\n <div><label>ClientId: <input class=\"oauth-client-id\" type=\"text\" name=\"client-id\"></label></div>\n <div><label>Secret: <input class=\"oauth-client-secret\" type=\"text\" name=\"client-secret\"></label></div>\n </div>\n </fieldset>\n";
},"8":function(container,depth0,helpers,partials,data) {
return "(Required)";
},"10":function(container,depth0,helpers,partials,data) {
var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing; var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
return " <li>\n <input class=\"oauth-scope\" type=\"checkbox\" data-scope=\"" return " <li>\n <input class=\"oauth-scope\" type=\"checkbox\" data-scope=\""
@@ -223,9 +245,9 @@ templates['oauth2'] = template({"1":function(container,depth0,helpers,partials,d
+ "</label><br/>\n <span class=\"api-scope-desc\">" + "</label><br/>\n <span class=\"api-scope-desc\">"
+ ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "") + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
+ "\n" + "\n"
+ ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.OAuthSchemeKey : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.OAuthSchemeKey : depth0),{"name":"if","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " </span>\n </li>\n"; + " </span>\n </li>\n";
},"2":function(container,depth0,helpers,partials,data) { },"11":function(container,depth0,helpers,partials,data) {
var stack1; var stack1;
return " (" return " ("
@@ -234,16 +256,21 @@ templates['oauth2'] = template({"1":function(container,depth0,helpers,partials,d
},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { },"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing; var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
return "<div>\n <h3 class=\"auth__title\">Select OAuth2.0 Scopes</h3>\n <p>" return "<div>\n <h3 class=\"auth__title\">OAuth2.0</h3>\n <p>"
+ ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "") + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
+ "</p>\n <p>Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes.\n <a href=\"#\">Learn how to use</a>\n </p>\n <p><strong> " + "</p>\n "
+ ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.appName : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "") + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.authorizationUrl : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " </strong> API requires the following scopes. Select which ones you want to grant to Swagger UI.</p>\n <p>Authorization URL: " + "\n "
+ ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.authorizationUrl : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "") + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.tokenUrl : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "</p>\n <p>flow: " + "\n <p>flow: "
+ ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.flow : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "") + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.flow : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
+ "</p>\n <ul class=\"api-popup-scopes\">\n" + "</p>\n"
+ ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.scopes : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isPasswordFlow : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.clientAuthentication : depth0),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " <p><strong> "
+ ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.appName : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
+ " </strong> API requires the following scopes. Select which ones you want to grant to Swagger UI.</p>\n <p>Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes.\n <a href=\"#\">Learn how to use</a>\n </p>\n <ul class=\"api-popup-scopes\">\n"
+ ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.scopes : depth0),{"name":"each","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " </ul>\n</div>"; + " </ul>\n</div>";
},"useData":true}); },"useData":true});
templates['operation'] = template({"1":function(container,depth0,helpers,partials,data) { templates['operation'] = template({"1":function(container,depth0,helpers,partials,data) {
@@ -585,7 +612,7 @@ templates['param_required'] = template({"1":function(container,depth0,helpers,pa
},"10":function(container,depth0,helpers,partials,data) { },"10":function(container,depth0,helpers,partials,data) {
var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing; var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
return " <input class='parameter' class='required' type='file' name='" return " <input class='parameter required' type='file' name='"
+ ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "") + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
+ "' id='" + "' id='"
+ ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "") + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")