Merge remote-tracking branch 'upstream/master' into JSONEditorMaster

Conflicts:
	dist/swagger-ui.js
	dist/swagger-ui.min.js
	src/main/javascript/view/OperationView.js
	src/main/less/screen.less
This commit is contained in:
Laurent Lepinay
2015-12-16 10:25:38 +01:00
32 changed files with 436 additions and 367 deletions

3
.gitattributes vendored
View File

@@ -1,6 +1,7 @@
* text eol=lf * text eol=lf
src/**/*.ttf binary
dist/**/*.js binary dist/**/*.js binary
dist/**/*.ttf binary
dist/**/*.map binary dist/**/*.map binary
dist/**/*.eot binary dist/**/*.eot binary
dist/**/*.svg binary dist/**/*.svg binary

4
.gitignore vendored
View File

@@ -12,4 +12,6 @@ swagger-ui.sublime-workspace
.idea .idea
.project .project
node_modules/* node_modules/*
/nbproject/private/ /nbproject/private/
dist/specs/
test/specs/local/

View File

@@ -1,8 +1,7 @@
sudo: false sudo: false
language: node_js language: node_js
node_js: node_js:
- '0.10' - '4.2'
- '0.12'
install: install:
- export DISPLAY=:99.0 - export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start - sh -e /etc/init.d/xvfb start

View File

@@ -62,7 +62,7 @@ This will start Swagger UI at `http://localhost:8080`.
Once you open the Swagger UI, it will load the [Swagger Petstore](http://petstore.swagger.io/v2/swagger.json) service and show its APIs. You can enter your own server url and click explore to view the API. Once you open the Swagger UI, it will load the [Swagger Petstore](http://petstore.swagger.io/v2/swagger.json) service and show its APIs. You can enter your own server url and click explore to view the API.
### Customize ### Customize
You may choose to customize Swagger UI for your organization. Here is an overview of whats in its various directories: You may choose to customize Swagger UI for your organization. Here is an overview of what's in its various directories:
- dist: Contains a distribution which you can deploy on a server or load from your local machine. - dist: Contains a distribution which you can deploy on a server or load from your local machine.
- dist/lang: The swagger localization - dist/lang: The swagger localization
@@ -98,6 +98,7 @@ booleanValues | SwaggerUI renders boolean data types as a dropdown. By default i
docExpansion | Controls how the API listing is displayed. It can be set to 'none' (default), 'list' (shows operations for each resource), or 'full' (fully expanded: shows operations and their details). docExpansion | Controls how the API listing is displayed. It can be set to 'none' (default), 'list' (shows operations for each resource), or 'full' (fully expanded: shows operations and their details).
apisSorter | Apply a sort to the API/tags list. It can be 'alpha' (sort by name) or a function (see Array.prototype.sort() to know how sort function works). Default is the order returned by the server unchanged. apisSorter | Apply a sort to the API/tags list. It can be 'alpha' (sort by name) or a function (see Array.prototype.sort() to know how sort function works). Default is the order returned by the server unchanged.
operationsSorter | Apply a sort to the operation list of each API. It can be 'alpha' (sort by paths alphanumerically), 'method' (sort by HTTP method) or a function (see Array.prototype.sort() to know how sort function works). Default is the order returned by the server unchanged. operationsSorter | Apply a sort to the operation list of each API. It can be 'alpha' (sort by paths alphanumerically), 'method' (sort by HTTP method) or a function (see Array.prototype.sort() to know how sort function works). Default is the order returned by the server unchanged.
defaultModelRendering | Controls how models are shown when the API is first rendered. (The user can always switch the rendering for a given model by clicking the 'Model' and 'Model Schema' links.) It can be set to 'model' or 'schema', and the default is 'schema'.
onComplete | This is a callback function parameter which can be passed to be notified of when SwaggerUI has completed rendering successfully. onComplete | This is a callback function parameter which can be passed to be notified of when SwaggerUI has completed rendering successfully.
onFailure | This is a callback function parameter which can be passed to be notified of when SwaggerUI encountered a failure was unable to render. onFailure | This is a callback function parameter which can be passed to be notified of when SwaggerUI encountered a failure was unable to render.
highlightSizeThreshold | Any size response below this threshold will be highlighted syntactically, attempting to highlight large responses can lead to browser hangs, not including a threshold will default to highlight all returned responses. highlightSizeThreshold | Any size response below this threshold will be highlighted syntactically, attempting to highlight large responses can lead to browser hangs, not including a threshold will default to highlight all returned responses.

14
dist/css/print.css vendored
View File

@@ -1136,14 +1136,14 @@
font-size: 24px; font-size: 24px;
padding: 10px 0; padding: 10px 0;
} }
.swagger-section .api-popup-dialog p.error-msg { .swagger-section .api-popup-dialog .error-msg {
padding-left: 5px; padding-left: 5px;
padding-bottom: 5px; padding-bottom: 5px;
} }
.swagger-section .api-popup-dialog button.api-popup-authbtn { .swagger-section .api-popup-dialog .api-popup-authbtn {
height: 30px; height: 30px;
} }
.swagger-section .api-popup-dialog button.api-popup-cancel { .swagger-section .api-popup-dialog .api-popup-cancel {
height: 30px; height: 30px;
} }
.swagger-section .api-popup-scopes { .swagger-section .api-popup-scopes {
@@ -1153,14 +1153,14 @@
padding: 5px 0; padding: 5px 0;
line-height: 20px; line-height: 20px;
} }
.swagger-section .api-popup-scopes .api-scope-desc {
padding-left: 20px;
font-style: italic;
}
.swagger-section .api-popup-scopes li input { .swagger-section .api-popup-scopes li input {
position: relative; position: relative;
top: 2px; top: 2px;
} }
.swagger-section .api-popup-scopes .api-scope-desc {
padding-left: 20px;
font-style: italic;
}
.swagger-section .api-popup-actions { .swagger-section .api-popup-actions {
padding-top: 10px; padding-top: 10px;
} }

52
dist/css/screen.css vendored
View File

@@ -1136,14 +1136,14 @@
font-size: 24px; font-size: 24px;
padding: 10px 0; padding: 10px 0;
} }
.swagger-section .api-popup-dialog p.error-msg { .swagger-section .api-popup-dialog .error-msg {
padding-left: 5px; padding-left: 5px;
padding-bottom: 5px; padding-bottom: 5px;
} }
.swagger-section .api-popup-dialog button.api-popup-authbtn { .swagger-section .api-popup-dialog .api-popup-authbtn {
height: 30px; height: 30px;
} }
.swagger-section .api-popup-dialog button.api-popup-cancel { .swagger-section .api-popup-dialog .api-popup-cancel {
height: 30px; height: 30px;
} }
.swagger-section .api-popup-scopes { .swagger-section .api-popup-scopes {
@@ -1153,14 +1153,14 @@
padding: 5px 0; padding: 5px 0;
line-height: 20px; line-height: 20px;
} }
.swagger-section .api-popup-scopes .api-scope-desc {
padding-left: 20px;
font-style: italic;
}
.swagger-section .api-popup-scopes li input { .swagger-section .api-popup-scopes li input {
position: relative; position: relative;
top: 2px; top: 2px;
} }
.swagger-section .api-popup-scopes .api-scope-desc {
padding-left: 20px;
font-style: italic;
}
.swagger-section .api-popup-actions { .swagger-section .api-popup-actions {
padding-top: 10px; padding-top: 10px;
} }
@@ -1234,32 +1234,29 @@
background-color: #89bf04; background-color: #89bf04;
padding: 14px; padding: 14px;
} }
.swagger-section #header a#logo { .swagger-section #input_baseUrl {
font-size: 1.5em; width: 400px;
font-weight: bold;
text-decoration: none;
background: transparent url(../images/logo_small.png) no-repeat left center;
padding: 20px 0 20px 40px;
color: white;
} }
.swagger-section #header form#api_selector { .swagger-section #api_selector {
display: block; display: block;
clear: none; clear: none;
float: right; float: right;
} }
.swagger-section #header form#api_selector .input { .swagger-section #api_selector .input {
display: block; display: block;
clear: none; clear: none;
float: left; float: left;
margin: 0 10px 0 0; margin: 0 10px 0 0;
} }
.swagger-section #header form#api_selector .input input#input_apiKey { .swagger-section #api_selector input {
font-size: 0.9em;
padding: 3px;
margin: 0;
}
.swagger-section #input_apiKey {
width: 200px; width: 200px;
} }
.swagger-section #header form#api_selector .input input#input_baseUrl { .swagger-section #explore {
width: 400px;
}
.swagger-section #header form#api_selector .input a#explore {
display: block; display: block;
text-decoration: none; text-decoration: none;
font-weight: bold; font-weight: bold;
@@ -1274,13 +1271,16 @@
-khtml-border-radius: 4px; -khtml-border-radius: 4px;
border-radius: 4px; border-radius: 4px;
} }
.swagger-section #header form#api_selector .input a#explore:hover { .swagger-section #explore:hover {
background-color: #547f00; background-color: #547f00;
} }
.swagger-section #header form#api_selector .input input { .swagger-section #header #logo {
font-size: 0.9em; font-size: 1.5em;
padding: 3px; font-weight: bold;
margin: 0; text-decoration: none;
background: transparent url(../images/logo_small.png) no-repeat left center;
padding: 20px 0 20px 40px;
color: white;
} }
.swagger-section #content_message { .swagger-section #content_message {
margin: 10px 15px; margin: 10px 15px;

4
dist/index.html vendored
View File

@@ -53,7 +53,8 @@
clientSecret: "your-client-secret-if-required", clientSecret: "your-client-secret-if-required",
realm: "your-realms", realm: "your-realms",
appName: "your-app-name", appName: "your-app-name",
scopeSeparator: "," scopeSeparator: ",",
additionalQueryStringParams: {}
}); });
} }
@@ -73,6 +74,7 @@
docExpansion: "none", docExpansion: "none",
jsonEditor:true, jsonEditor:true,
apisSorter: "alpha", apisSorter: "alpha",
defaultModelRendering: 'schema',
showRequestHeaders: false showRequestHeaders: false
}); });

View File

@@ -7,6 +7,7 @@ var oauth2KeyName;
var redirect_uri; var redirect_uri;
var clientSecret; var clientSecret;
var scopeSeparator; var scopeSeparator;
var additionalQueryStringParams;
function handleLogin() { function handleLogin() {
var scopes = []; var scopes = [];
@@ -156,6 +157,9 @@ function handleLogin() {
url += '&client_id=' + encodeURIComponent(clientId); url += '&client_id=' + encodeURIComponent(clientId);
url += '&scope=' + encodeURIComponent(scopes.join(scopeSeparator)); url += '&scope=' + encodeURIComponent(scopes.join(scopeSeparator));
url += '&state=' + encodeURIComponent(state); url += '&state=' + encodeURIComponent(state);
for (var key in additionalQueryStringParams) {
url += '&' + key + '=' + encodeURIComponent(additionalQueryStringParams[key]);
}
window.open(url); window.open(url);
}); });
@@ -190,6 +194,7 @@ function initOAuth(opts) {
clientSecret = (o.clientSecret||null); clientSecret = (o.clientSecret||null);
realm = (o.realm||errors.push('missing realm')); realm = (o.realm||errors.push('missing realm'));
scopeSeparator = (o.scopeSeparator||' '); scopeSeparator = (o.scopeSeparator||' ');
additionalQueryStringParams = (o.additionalQueryStringParams||{});
if(errors.length > 0){ if(errors.length > 0){
log('auth unable initialize oauth: ' + errors); log('auth unable initialize oauth: ' + errors);

133
dist/swagger-ui.js vendored
View File

@@ -21,10 +21,9 @@ this["Handlebars"]["templates"]["content_type"] = Handlebars.template({"1":funct
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
return buffer; return buffer;
},"2":function(depth0,helpers,partials,data) { },"2":function(depth0,helpers,partials,data) {
var stack1, lambda=this.lambda, buffer = " <option value=\""; var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression, buffer = " <option value=\""
stack1 = lambda(depth0, depth0); + escapeExpression(lambda(depth0, depth0))
if (stack1 != null) { buffer += stack1; } + "\">";
buffer += "\">";
stack1 = lambda(depth0, depth0); stack1 = lambda(depth0, depth0);
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
return buffer + "</option>\n"; return buffer + "</option>\n";
@@ -150,23 +149,24 @@ window.Docs = {
Docs.expandEndpointListForResource(fragments[0]); Docs.expandEndpointListForResource(fragments[0]);
$("#"+dom_id).slideto({highlight: false}); $("#"+dom_id).slideto({highlight: false});
// Expand operation // Expand operation
var li_dom_id = fragments.join('_'); var li_dom_id = fragments.join('_');
var li_content_dom_id = li_dom_id + "_content"; var li_content_dom_id = li_dom_id + "_content";
Docs.expandOperation($('#'+li_content_dom_id)); Docs.expandOperation($('#'+li_content_dom_id));
$('#'+li_dom_id).slideto({highlight: false}); $('#'+li_dom_id).slideto({highlight: false});
break; break;
} }
}, },
toggleEndpointListForResource: function(resource) { toggleEndpointListForResource: function(resource) {
var elem = $('li#resource_' + Docs.escapeResourceName(resource) + ' ul.endpoints'); var elem = $('li#resource_' + Docs.escapeResourceName(resource) + ' ul.endpoints');
if (elem.is(':visible')) { if (elem.is(':visible')) {
$.bbq.pushState('#/', 2);
Docs.collapseEndpointListForResource(resource); Docs.collapseEndpointListForResource(resource);
} else { } else {
$.bbq.pushState('#/' + resource, 2);
Docs.expandEndpointListForResource(resource); Docs.expandEndpointListForResource(resource);
} }
}, },
@@ -250,7 +250,8 @@ Handlebars.registerHelper('sanitize', function(html) {
Handlebars.registerHelper('renderTextParam', function(param) { Handlebars.registerHelper('renderTextParam', function(param) {
var result, type = 'text', idAtt = ''; var result, type = 'text', idAtt = '';
var isArray = param.type.toLowerCase() === 'array' || param.allowMultiple; var paramType = param.type || param.schema.type || '';
var isArray = paramType.toLowerCase() === 'array' || param.allowMultiple;
var defaultValue = isArray && Array.isArray(param.default) ? param.default.join('\n') : param.default; var defaultValue = isArray && Array.isArray(param.default) ? param.default.join('\n') : param.default;
var dataVendorExtensions = Object.keys(param).filter(function(property) { var dataVendorExtensions = Object.keys(param).filter(function(property) {
@@ -273,6 +274,8 @@ Handlebars.registerHelper('renderTextParam', function(param) {
idAtt = ' id=\'' + param.valueId + '\''; idAtt = ' id=\'' + param.valueId + '\'';
} }
defaultValue = defaultValue.replace(/'/g,'&apos;');
if(isArray) { if(isArray) {
result = '<textarea class=\'body-textarea' + (param.required ? ' required' : '') + '\' name=\'' + param.name + '\'' + idAtt + dataVendorExtensions; result = '<textarea class=\'body-textarea' + (param.required ? ' required' : '') + '\' name=\'' + param.name + '\'' + idAtt + dataVendorExtensions;
result += ' placeholder=\'Provide multiple values in new lines' + (param.required ? ' (at least one required).' : '.') + '\'>'; result += ' placeholder=\'Provide multiple values in new lines' + (param.required ? ' (at least one required).' : '.') + '\'>';
@@ -387,9 +390,9 @@ this["Handlebars"]["templates"]["main"] = Handlebars.template({"1":function(dept
this["Handlebars"]["templates"]["operation"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { this["Handlebars"]["templates"]["operation"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
return "deprecated"; return "deprecated";
},"3":function(depth0,helpers,partials,data) { },"3":function(depth0,helpers,partials,data) {
return " <h4>Warning: Deprecated</h4>\n"; return " <h4><span data-sw-translate>Warning: Deprecated</span></h4>\n";
},"5":function(depth0,helpers,partials,data) { },"5":function(depth0,helpers,partials,data) {
var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, buffer = " <h4>Implementation Notes</h4>\n <div class=\"markdown\">"; var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, buffer = " <h4><span data-sw-translate>Implementation Notes</span></h4>\n <div class=\"markdown\">";
stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper)); stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper));
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
return buffer + "</div>\n"; return buffer + "</div>\n";
@@ -412,19 +415,26 @@ this["Handlebars"]["templates"]["operation"] = Handlebars.template({"1":function
},"14":function(depth0,helpers,partials,data) { },"14":function(depth0,helpers,partials,data) {
return " <div class='access'>\n <span class=\"api-ic ic-off\" title=\"click to authenticate\"></span>\n </div>\n"; return " <div class='access'>\n <span class=\"api-ic ic-off\" title=\"click to authenticate\"></span>\n </div>\n";
},"16":function(depth0,helpers,partials,data) { },"16":function(depth0,helpers,partials,data) {
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = " <h4><span data-sw-translate>Response Class</span> (<span data-sw-translate>Status</span> "
return " <h4><span data-sw-translate>Response Class</span> (<span data-sw-translate>Status</span> "
+ escapeExpression(((helper = (helper = helpers.successCode || (depth0 != null ? depth0.successCode : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"successCode","hash":{},"data":data}) : helper))) + escapeExpression(((helper = (helper = helpers.successCode || (depth0 != null ? depth0.successCode : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"successCode","hash":{},"data":data}) : helper)))
+ ")</h4>\n <p><span class=\"model-signature\" /></p>\n <br/>\n <div class=\"response-content-type\" />\n"; + ")</h4>\n ";
},"18":function(depth0,helpers,partials,data) { stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.successDescription : depth0), {"name":"if","hash":{},"fn":this.program(17, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; }
return buffer + "\n <p><span class=\"model-signature\" /></p>\n <br/>\n <div class=\"response-content-type\" />\n\n";
},"17":function(depth0,helpers,partials,data) {
var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, buffer = "<div class=\"markdown\">";
stack1 = ((helper = (helper = helpers.successDescription || (depth0 != null ? depth0.successDescription : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"successDescription","hash":{},"data":data}) : helper));
if (stack1 != null) { buffer += stack1; }
return buffer + "</div>";
},"19":function(depth0,helpers,partials,data) {
return " <h4 data-sw-translate>Parameters</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th style=\"width: 100px; max-width: 100px\" data-sw-translate>Parameter</th>\n <th style=\"width: 310px; max-width: 310px\" data-sw-translate>Value</th>\n <th style=\"width: 200px; max-width: 200px\" data-sw-translate>Description</th>\n <th style=\"width: 100px; max-width: 100px\" data-sw-translate>Parameter Type</th>\n <th style=\"width: 220px; max-width: 230px\" data-sw-translate>Data Type</th>\n </tr>\n </thead>\n <tbody class=\"operation-params\">\n\n </tbody>\n </table>\n"; return " <h4 data-sw-translate>Parameters</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th style=\"width: 100px; max-width: 100px\" data-sw-translate>Parameter</th>\n <th style=\"width: 310px; max-width: 310px\" data-sw-translate>Value</th>\n <th style=\"width: 200px; max-width: 200px\" data-sw-translate>Description</th>\n <th style=\"width: 100px; max-width: 100px\" data-sw-translate>Parameter Type</th>\n <th style=\"width: 220px; max-width: 230px\" data-sw-translate>Data Type</th>\n </tr>\n </thead>\n <tbody class=\"operation-params\">\n\n </tbody>\n </table>\n";
},"20":function(depth0,helpers,partials,data) { },"21":function(depth0,helpers,partials,data) {
return " <div style='margin:0;padding:0;display:inline'></div>\n <h4 data-sw-translate>Response Messages</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th data-sw-translate>HTTP Status Code</th>\n <th data-sw-translate>Reason</th>\n <th data-sw-translate>Response Model</th>\n <th data-sw-translate>Headers</th>\n </tr>\n </thead>\n <tbody class=\"operation-status\">\n\n </tbody>\n </table>\n"; return " <div style='margin:0;padding:0;display:inline'></div>\n <h4 data-sw-translate>Response Messages</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th data-sw-translate>HTTP Status Code</th>\n <th data-sw-translate>Reason</th>\n <th data-sw-translate>Response Model</th>\n <th data-sw-translate>Headers</th>\n </tr>\n </thead>\n <tbody class=\"operation-status\">\n </tbody>\n </table>\n";
},"22":function(depth0,helpers,partials,data) { },"23":function(depth0,helpers,partials,data) {
return ""; return "";
},"24":function(depth0,helpers,partials,data) { },"25":function(depth0,helpers,partials,data) {
return " <div class='sandbox_header'>\n <input class='submit' type='button' value='Try it out!' data-sw-translate/>\n <a href='#' class='response_hider' style='display:none' data-sw-translate>Hide Response</a>\n <span class='response_throbber' style='display:none'></span>\n </div>\n"; return " <div class='sandbox_header'>\n <input class='submit' type='button' value='Try it out!' data-sw-translate/>\n <a href='#' class='response_hider' style='display:none' data-sw-translate>Hide Response</a>\n <span class='response_throbber' style='display:none'></span>\n </div>\n";
},"26":function(depth0,helpers,partials,data) { },"27":function(depth0,helpers,partials,data) {
return " <h4 data-sw-translate>Request Headers</h4>\n <div class='block request_headers'></div>\n"; return " <h4 data-sw-translate>Request Headers</h4>\n <div class='block request_headers'></div>\n";
},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing, buffer = "\n <ul class='operations' >\n <li class='" var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing, buffer = "\n <ul class='operations' >\n <li class='"
@@ -481,14 +491,14 @@ this["Handlebars"]["templates"]["operation"] = Handlebars.template({"1":function
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.type : depth0), {"name":"if","hash":{},"fn":this.program(16, data),"inverse":this.noop,"data":data}); stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.type : depth0), {"name":"if","hash":{},"fn":this.program(16, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
buffer += " <form accept-charset='UTF-8' class='sandbox'>\n <div style='margin:0;padding:0;display:inline'></div>\n"; buffer += " <form accept-charset='UTF-8' class='sandbox'>\n <div style='margin:0;padding:0;display:inline'></div>\n";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.parameters : depth0), {"name":"if","hash":{},"fn":this.program(18, data),"inverse":this.noop,"data":data}); stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.parameters : depth0), {"name":"if","hash":{},"fn":this.program(19, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.responseMessages : depth0), {"name":"if","hash":{},"fn":this.program(20, data),"inverse":this.noop,"data":data}); stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.responseMessages : depth0), {"name":"if","hash":{},"fn":this.program(21, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isReadOnly : depth0), {"name":"if","hash":{},"fn":this.program(22, data),"inverse":this.program(24, data),"data":data}); stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isReadOnly : depth0), {"name":"if","hash":{},"fn":this.program(23, data),"inverse":this.program(25, data),"data":data});
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
buffer += " </form>\n <div class='response' style='display:none'>\n <h4 class='curl'>Curl</h4>\n <div class='block curl'></div>\n <h4 data-sw-translate>Request URL</h4>\n <div class='block request_url'></div>\n"; buffer += " </form>\n <div class='response' style='display:none'>\n <h4 class='curl'>Curl</h4>\n <div class='block curl'></div>\n <h4 data-sw-translate>Request URL</h4>\n <div class='block request_url'></div>\n";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.showRequestHeaders : depth0), {"name":"if","hash":{},"fn":this.program(26, data),"inverse":this.noop,"data":data}); stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.showRequestHeaders : depth0), {"name":"if","hash":{},"fn":this.program(27, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
return buffer + " <h4 data-sw-translate>Response Body</h4>\n <div class='block response_body'></div>\n <h4 data-sw-translate>Response Code</h4>\n <div class='block response_code'></div>\n <h4 data-sw-translate>Response Headers</h4>\n <div class='block response_headers'></div>\n </div>\n </div>\n </li>\n </ul>\n"; return buffer + " <h4 data-sw-translate>Response Body</h4>\n <div class='block response_body'></div>\n <h4 data-sw-translate>Response Code</h4>\n <div class='block response_code'></div>\n <h4 data-sw-translate>Response Headers</h4>\n <div class='block response_headers'></div>\n </div>\n </div>\n </li>\n </ul>\n";
},"useData":true}); },"useData":true});
@@ -606,7 +616,7 @@ this["Handlebars"]["templates"]["param_readonly"] = Handlebars.template({"1":fun
+ escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper))) + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ "'>" + "'>"
+ escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper))) + escapeExpression(((helper = (helper = helpers['default'] || (depth0 != null ? depth0['default'] : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"default","hash":{},"data":data}) : helper)))
+ "</textarea>\n"; + "</textarea>\n <div class=\"parameter-content-type\" />\n";
},"3":function(depth0,helpers,partials,data) { },"3":function(depth0,helpers,partials,data) {
var stack1, buffer = ""; var stack1, buffer = "";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0['default'] : depth0), {"name":"if","hash":{},"fn":this.program(4, data),"inverse":this.program(6, data),"data":data}); stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0['default'] : depth0), {"name":"if","hash":{},"fn":this.program(4, data),"inverse":this.program(6, data),"data":data});
@@ -770,10 +780,9 @@ this["Handlebars"]["templates"]["parameter_content_type"] = Handlebars.template(
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
return buffer; return buffer;
},"2":function(depth0,helpers,partials,data) { },"2":function(depth0,helpers,partials,data) {
var stack1, lambda=this.lambda, buffer = " <option value=\""; var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression, buffer = " <option value=\""
stack1 = lambda(depth0, depth0); + escapeExpression(lambda(depth0, depth0))
if (stack1 != null) { buffer += stack1; } + "\">";
buffer += "\">";
stack1 = lambda(depth0, depth0); stack1 = lambda(depth0, depth0);
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
return buffer + "</option>\n"; return buffer + "</option>\n";
@@ -832,10 +841,9 @@ this["Handlebars"]["templates"]["response_content_type"] = Handlebars.template({
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
return buffer; return buffer;
},"2":function(depth0,helpers,partials,data) { },"2":function(depth0,helpers,partials,data) {
var stack1, lambda=this.lambda, buffer = " <option value=\""; var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression, buffer = " <option value=\""
stack1 = lambda(depth0, depth0); + escapeExpression(lambda(depth0, depth0))
if (stack1 != null) { buffer += stack1; } + "\">";
buffer += "\">";
stack1 = lambda(depth0, depth0); stack1 = lambda(depth0, depth0);
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
return buffer + "</option>\n"; return buffer + "</option>\n";
@@ -30726,7 +30734,12 @@ window.SwaggerUi = Backbone.Router.extend({
// SwaggerUi accepts all the same options as SwaggerApi // SwaggerUi accepts all the same options as SwaggerApi
initialize: function(options) { initialize: function(options) {
options = options || {}; options = options || {};
if(!options.highlightSizeThreshold) {
if (options.defaultModelRendering !== 'model') {
options.defaultModelRendering = 'schema';
}
if (!options.highlightSizeThreshold) {
options.highlightSizeThreshold = 100000; options.highlightSizeThreshold = 100000;
} }
@@ -30899,7 +30912,7 @@ window.SwaggerUi = Backbone.Router.extend({
var $msgbar = $('#message-bar'); var $msgbar = $('#message-bar');
$msgbar.removeClass('message-fail'); $msgbar.removeClass('message-fail');
$msgbar.addClass('message-success'); $msgbar.addClass('message-success');
$msgbar.html(data); $msgbar.text(data);
if(window.SwaggerTranslator) { if(window.SwaggerTranslator) {
window.SwaggerTranslator.translate($msgbar); window.SwaggerTranslator.translate($msgbar);
} }
@@ -31067,9 +31080,10 @@ SwaggerUi.Views.BasicAuthButton = Backbone.View.extend({
'click #apply_basic_auth' : 'applyPassword' 'click #apply_basic_auth' : 'applyPassword'
}, },
applyPassword: function(){ applyPassword: function(event){
var username = $('.input_username').val(); event.preventDefault();
var password = $('.input_password').val(); var username = $('#input_username').val();
var password = $('#input_password').val();
var basicAuth = new SwaggerClient.PasswordAuthorization('basic', username, password); var basicAuth = new SwaggerClient.PasswordAuthorization('basic', username, password);
this.router.api.clientAuthorizations.add(this.model.type, basicAuth); this.router.api.clientAuthorizations.add(this.model.type, basicAuth);
this.router.load(); this.router.load();
@@ -31328,6 +31342,14 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
this.parentId = this.model.parentId; this.parentId = this.model.parentId;
this.nickname = this.model.nickname; this.nickname = this.model.nickname;
this.model.encodedParentId = encodeURIComponent(this.parentId); this.model.encodedParentId = encodeURIComponent(this.parentId);
if (opts.swaggerOptions) {
this.model.defaultRendering = opts.swaggerOptions.defaultModelRendering;
if (opts.swaggerOptions.showRequestHeaders) {
this.model.showRequestHeaders = true;
}
}
return this; return this;
}, },
@@ -31469,6 +31491,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
value = successResponse[key]; value = successResponse[key];
this.model.successCode = key; this.model.successCode = key;
if (typeof value === 'object' && typeof value.createJSONSample === 'function') { if (typeof value === 'object' && typeof value.createJSONSample === 'function') {
this.model.successDescription = value.description;
signatureModel = { signatureModel = {
sampleJSON: JSON.stringify(value.createJSONSample(), void 0, 2), sampleJSON: JSON.stringify(value.createJSONSample(), void 0, 2),
isParam: false, isParam: false,
@@ -31483,12 +31506,9 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
signature: this.model.responseClassSignature signature: this.model.responseClassSignature
}; };
} }
var opts = this.options.swaggerOptions;
if (opts.showRequestHeaders) {
this.model.showRequestHeaders = true;
}
$(this.el).html(Handlebars.templates.operation(this.model)); $(this.el).html(Handlebars.templates.operation(this.model));
if (signatureModel) { if (signatureModel) {
signatureModel.defaultRendering = this.model.defaultRendering;
responseSignatureView = new SwaggerUi.Views.SignatureView({ responseSignatureView = new SwaggerUi.Views.SignatureView({
model: signatureModel, model: signatureModel,
router: this.router, router: this.router,
@@ -31547,7 +31567,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
addParameter: function(param, consumes) { addParameter: function(param, consumes) {
// Render a parameter // Render a parameter
param.consumes = consumes; param.consumes = consumes;
param.defaultRendering = this.model.defaultRendering;
// Copy this param JSON spec so that it will be available for JsonEditor // Copy this param JSON spec so that it will be available for JsonEditor
if(param.schema){ if(param.schema){
@@ -31565,7 +31585,6 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
param.schema.title = ' '; param.schema.title = ' ';
} }
} }
var paramView = new SwaggerUi.Views.ParameterView({ var paramView = new SwaggerUi.Views.ParameterView({
model: param, model: param,
@@ -31578,6 +31597,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
addStatusCode: function(statusCode) { addStatusCode: function(statusCode) {
// Render status codes // Render status codes
statusCode.defaultRendering = this.model.defaultRendering;
var statusCodeView = new SwaggerUi.Views.StatusCodeView({ var statusCodeView = new SwaggerUi.Views.StatusCodeView({
model: statusCode, model: statusCode,
tagName: 'tr', tagName: 'tr',
@@ -31982,8 +32002,8 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
$('.response_throbber', $(this.el)).hide(); $('.response_throbber', $(this.el)).hide();
//adds curl output // adds curl output
var curlCommand = this.model.asCurl(this.map); var curlCommand = this.model.asCurl(this.map, {responseContentType: contentType});
curlCommand = curlCommand.replace('!', '&#33;'); curlCommand = curlCommand.replace('!', '&#33;');
$( 'div.curl', $(this.el)).html('<pre>' + curlCommand + '</pre>'); $( 'div.curl', $(this.el)).html('<pre>' + curlCommand + '</pre>');
@@ -32010,11 +32030,10 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
toggleOperationContent: function (event) { toggleOperationContent: function (event) {
var elem = $('#' + Docs.escapeResourceName(this.parentId + '_' + this.nickname + '_content')); var elem = $('#' + Docs.escapeResourceName(this.parentId + '_' + this.nickname + '_content'));
if (elem.is(':visible')){ if (elem.is(':visible')){
event.preventDefault();
$.bbq.pushState('#/', 2); $.bbq.pushState('#/', 2);
event.preventDefault();
Docs.collapseOperation(elem); Docs.collapseOperation(elem);
} else { } else {
event.preventDefault();
Docs.expandOperation(elem); Docs.expandOperation(elem);
} }
}, },
@@ -32116,7 +32135,8 @@ SwaggerUi.Views.ParameterView = Backbone.View.extend({
var signatureModel = { var signatureModel = {
sampleJSON: this.model.sampleJSON, sampleJSON: this.model.sampleJSON,
isParam: true, isParam: true,
signature: this.model.signature signature: this.model.signature,
defaultRendering: this.model.defaultRendering
}; };
if (this.model.sampleJSON) { if (this.model.sampleJSON) {
@@ -32307,8 +32327,12 @@ SwaggerUi.Views.SignatureView = Backbone.View.extend({
$(this.el).html(Handlebars.templates.signature(this.model)); $(this.el).html(Handlebars.templates.signature(this.model));
this.switchToSnippet(); if (this.model.defaultRendering === 'model') {
this.switchToDescription();
} else {
this.switchToSnippet();
}
this.isParam = this.model.isParam; this.isParam = this.model.isParam;
if (this.isParam) { if (this.isParam) {
@@ -32372,6 +32396,7 @@ SwaggerUi.Views.StatusCodeView = Backbone.View.extend({
sampleJSON: JSON.stringify(this.router.api.models[this.model.responseModel].createJSONSample(), null, 2), sampleJSON: JSON.stringify(this.router.api.models[this.model.responseModel].createJSONSample(), null, 2),
isParam: false, isParam: false,
signature: this.router.api.models[this.model.responseModel].getMockSignature(), signature: this.router.api.models[this.model.responseModel].getMockSignature(),
defaultRendering: this.model.defaultRendering
}; };
var responseModelView = new SwaggerUi.Views.SignatureView({model: responseModel, tagName: 'div'}); var responseModelView = new SwaggerUi.Views.SignatureView({model: responseModel, tagName: 'div'});

File diff suppressed because one or more lines are too long

View File

@@ -13,9 +13,10 @@ var declare = require('gulp-declare');
var watch = require('gulp-watch'); var watch = require('gulp-watch');
var connect = require('gulp-connect'); var connect = require('gulp-connect');
var header = require('gulp-header'); var header = require('gulp-header');
var pkg = require('./package.json');
var order = require('gulp-order'); var order = require('gulp-order');
var jshint = require('gulp-jshint'); var jshint = require('gulp-jshint');
var pkg = require('./package.json');
var banner = ['/**', var banner = ['/**',
' * <%= pkg.name %> - <%= pkg.description %>', ' * <%= pkg.name %> - <%= pkg.description %>',
' * @version v<%= pkg.version %>', ' * @version v<%= pkg.version %>',
@@ -34,21 +35,6 @@ gulp.task('clean', function() {
.on('error', log); .on('error', log);
}); });
/**
* Processes Handlebars templates
*/
function templates() {
return gulp
.src(['./src/main/template/**/*'])
.pipe(handlebars())
.pipe(wrap('Handlebars.template(<%= contents %>)'))
.pipe(declare({
namespace: 'Handlebars.templates',
noRedeclare: true, // Avoid duplicate declarations
}))
.on('error', log);
}
/** /**
* JShint all *.js files * JShint all *.js files
*/ */
@@ -61,19 +47,27 @@ gulp.task('lint', function () {
/** /**
* Build a distribution * Build a distribution
*/ */
gulp.task('dist', ['clean','lint'], function() { gulp.task('dist', ['clean', 'lint'], _dist);
function _dist() {
return es.merge( return es.merge(
gulp.src([ gulp.src([
'./src/main/javascript/**/*.js', './src/main/javascript/**/*.js',
'./node_modules/swagger-client/browser/swagger-client.js' './node_modules/swagger-client/browser/swagger-client.js'
]), ]),
templates() gulp
.src(['./src/main/template/**/*'])
.pipe(handlebars())
.pipe(wrap('Handlebars.template(<%= contents %>)'))
.pipe(declare({
namespace: 'Handlebars.templates',
noRedeclare: true, // Avoid duplicate declarations
}))
.on('error', log)
) )
.pipe(order(['scripts.js', 'templates.js'])) .pipe(order(['scripts.js', 'templates.js']))
.pipe(concat('swagger-ui.js')) .pipe(concat('swagger-ui.js'))
.pipe(wrap('(function(){<%= contents %>}).call(this);')) .pipe(wrap('(function(){<%= contents %>}).call(this);'))
.pipe(header(banner, { pkg: pkg } )) .pipe(header(banner, { pkg: pkg }))
.pipe(gulp.dest('./dist')) .pipe(gulp.dest('./dist'))
.pipe(uglify()) .pipe(uglify())
.on('error', log) .on('error', log)
@@ -81,13 +75,14 @@ gulp.task('dist', ['clean','lint'], function() {
.on('error', log) .on('error', log)
.pipe(gulp.dest('./dist')) .pipe(gulp.dest('./dist'))
.pipe(connect.reload()); .pipe(connect.reload());
}); }
gulp.task('dev-dist', ['lint', 'dev-copy'], _dist);
/** /**
* Processes less files into CSS files * Processes less files into CSS files
*/ */
gulp.task('less', ['clean'], function() { gulp.task('less', ['clean'], _less);
function _less() {
return gulp return gulp
.src([ .src([
'./src/main/less/screen.less', './src/main/less/screen.less',
@@ -99,14 +94,14 @@ gulp.task('less', ['clean'], function() {
.on('error', log) .on('error', log)
.pipe(gulp.dest('./src/main/html/css/')) .pipe(gulp.dest('./src/main/html/css/'))
.pipe(connect.reload()); .pipe(connect.reload());
}); }
gulp.task('dev-less', _less);
/** /**
* Copy lib and html folders * Copy lib and html folders
*/ */
gulp.task('copy', ['less'], function() { gulp.task('copy', ['less'], _copy);
function _copy() {
// copy JavaScript files inside lib folder // copy JavaScript files inside lib folder
gulp gulp
.src(['./lib/**/*.{js,map}']) .src(['./lib/**/*.{js,map}'])
@@ -124,15 +119,29 @@ gulp.task('copy', ['less'], function() {
.src(['./src/main/html/**/*']) .src(['./src/main/html/**/*'])
.pipe(gulp.dest('./dist')) .pipe(gulp.dest('./dist'))
.on('error', log); .on('error', log);
}
gulp.task('dev-copy', ['dev-less', 'copy-local-specs'], _copy);
gulp.task('copy-local-specs', function () {
// copy the test specs
return gulp
.src(['./test/specs/**/*'])
.pipe(gulp.dest('./dist/specs'))
.on('error', log);
}); });
/** /**
* Watch for changes and recompile * Watch for changes and recompile
*/ */
gulp.task('watch', function() { gulp.task('watch', ['copy-local-specs'], function() {
return watch(['./src/**/*.{js,less,handlebars}'], function() { return watch([
gulp.start('default'); './src/**/*.{js,less,handlebars}',
}); './src/main/html/*.html',
'./test/specs/**/*.{json,yaml}'
],
function() {
gulp.start('dev-dist');
});
}); });
/** /**
@@ -149,6 +158,8 @@ function log(error) {
console.error(error.toString && error.toString()); console.error(error.toString && error.toString());
} }
gulp.task('default', ['dist', 'copy']); gulp.task('default', ['dist', 'copy']);
gulp.task('serve', ['connect', 'watch']); gulp.task('serve', ['connect', 'watch']);
gulp.task('dev', ['default'], function () {
gulp.start('serve');
});

View File

@@ -1,7 +1,9 @@
'use strict';
var pack = require('./package'); var pack = require('./package');
var path = require('path'); var path = require('path');
module.exports = { module.exports = {
version: pack.version, version: pack.version,
dist: path.resolve(__dirname, 'dist') dist: path.resolve(__dirname, 'dist')
}; };

View File

@@ -7,6 +7,7 @@ var oauth2KeyName;
var redirect_uri; var redirect_uri;
var clientSecret; var clientSecret;
var scopeSeparator; var scopeSeparator;
var additionalQueryStringParams;
function handleLogin() { function handleLogin() {
var scopes = []; var scopes = [];
@@ -156,6 +157,9 @@ function handleLogin() {
url += '&client_id=' + encodeURIComponent(clientId); url += '&client_id=' + encodeURIComponent(clientId);
url += '&scope=' + encodeURIComponent(scopes.join(scopeSeparator)); url += '&scope=' + encodeURIComponent(scopes.join(scopeSeparator));
url += '&state=' + encodeURIComponent(state); url += '&state=' + encodeURIComponent(state);
for (var key in additionalQueryStringParams) {
url += '&' + key + '=' + encodeURIComponent(additionalQueryStringParams[key]);
}
window.open(url); window.open(url);
}); });
@@ -190,6 +194,7 @@ function initOAuth(opts) {
clientSecret = (o.clientSecret||null); clientSecret = (o.clientSecret||null);
realm = (o.realm||errors.push('missing realm')); realm = (o.realm||errors.push('missing realm'));
scopeSeparator = (o.scopeSeparator||' '); scopeSeparator = (o.scopeSeparator||' ');
additionalQueryStringParams = (o.additionalQueryStringParams||{});
if(errors.length > 0){ if(errors.length > 0){
log('auth unable initialize oauth: ' + errors); log('auth unable initialize oauth: ' + errors);

View File

@@ -45,11 +45,11 @@
"gulp-uglify": "^1.1.0", "gulp-uglify": "^1.1.0",
"gulp-watch": "^4.1.1", "gulp-watch": "^4.1.1",
"gulp-wrap": "^0.11.0", "gulp-wrap": "^0.11.0",
"http-server": "git+https://github.com/nodeapps/http-server.git", "http-server": "^0.8.0",
"jshint-stylish": "^1.0.1", "jshint-stylish": "^1.0.1",
"less": "^2.4.0", "less": "^2.4.0",
"mocha": "^2.1.0", "mocha": "^2.1.0",
"selenium-webdriver": "^2.45.0", "selenium-webdriver": "^2.45.0",
"swagger-client": "2.1.6" "swagger-client": "2.1.9"
} }
} }

View File

@@ -1136,14 +1136,14 @@
font-size: 24px; font-size: 24px;
padding: 10px 0; padding: 10px 0;
} }
.swagger-section .api-popup-dialog p.error-msg { .swagger-section .api-popup-dialog .error-msg {
padding-left: 5px; padding-left: 5px;
padding-bottom: 5px; padding-bottom: 5px;
} }
.swagger-section .api-popup-dialog button.api-popup-authbtn { .swagger-section .api-popup-dialog .api-popup-authbtn {
height: 30px; height: 30px;
} }
.swagger-section .api-popup-dialog button.api-popup-cancel { .swagger-section .api-popup-dialog .api-popup-cancel {
height: 30px; height: 30px;
} }
.swagger-section .api-popup-scopes { .swagger-section .api-popup-scopes {
@@ -1153,14 +1153,14 @@
padding: 5px 0; padding: 5px 0;
line-height: 20px; line-height: 20px;
} }
.swagger-section .api-popup-scopes .api-scope-desc {
padding-left: 20px;
font-style: italic;
}
.swagger-section .api-popup-scopes li input { .swagger-section .api-popup-scopes li input {
position: relative; position: relative;
top: 2px; top: 2px;
} }
.swagger-section .api-popup-scopes .api-scope-desc {
padding-left: 20px;
font-style: italic;
}
.swagger-section .api-popup-actions { .swagger-section .api-popup-actions {
padding-top: 10px; padding-top: 10px;
} }

View File

@@ -1136,14 +1136,14 @@
font-size: 24px; font-size: 24px;
padding: 10px 0; padding: 10px 0;
} }
.swagger-section .api-popup-dialog p.error-msg { .swagger-section .api-popup-dialog .error-msg {
padding-left: 5px; padding-left: 5px;
padding-bottom: 5px; padding-bottom: 5px;
} }
.swagger-section .api-popup-dialog button.api-popup-authbtn { .swagger-section .api-popup-dialog .api-popup-authbtn {
height: 30px; height: 30px;
} }
.swagger-section .api-popup-dialog button.api-popup-cancel { .swagger-section .api-popup-dialog .api-popup-cancel {
height: 30px; height: 30px;
} }
.swagger-section .api-popup-scopes { .swagger-section .api-popup-scopes {
@@ -1153,14 +1153,14 @@
padding: 5px 0; padding: 5px 0;
line-height: 20px; line-height: 20px;
} }
.swagger-section .api-popup-scopes .api-scope-desc {
padding-left: 20px;
font-style: italic;
}
.swagger-section .api-popup-scopes li input { .swagger-section .api-popup-scopes li input {
position: relative; position: relative;
top: 2px; top: 2px;
} }
.swagger-section .api-popup-scopes .api-scope-desc {
padding-left: 20px;
font-style: italic;
}
.swagger-section .api-popup-actions { .swagger-section .api-popup-actions {
padding-top: 10px; padding-top: 10px;
} }
@@ -1234,32 +1234,29 @@
background-color: #89bf04; background-color: #89bf04;
padding: 14px; padding: 14px;
} }
.swagger-section #header a#logo { .swagger-section #input_baseUrl {
font-size: 1.5em; width: 400px;
font-weight: bold;
text-decoration: none;
background: transparent url(../images/logo_small.png) no-repeat left center;
padding: 20px 0 20px 40px;
color: white;
} }
.swagger-section #header form#api_selector { .swagger-section #api_selector {
display: block; display: block;
clear: none; clear: none;
float: right; float: right;
} }
.swagger-section #header form#api_selector .input { .swagger-section #api_selector .input {
display: block; display: block;
clear: none; clear: none;
float: left; float: left;
margin: 0 10px 0 0; margin: 0 10px 0 0;
} }
.swagger-section #header form#api_selector .input input#input_apiKey { .swagger-section #api_selector input {
font-size: 0.9em;
padding: 3px;
margin: 0;
}
.swagger-section #input_apiKey {
width: 200px; width: 200px;
} }
.swagger-section #header form#api_selector .input input#input_baseUrl { .swagger-section #explore {
width: 400px;
}
.swagger-section #header form#api_selector .input a#explore {
display: block; display: block;
text-decoration: none; text-decoration: none;
font-weight: bold; font-weight: bold;
@@ -1274,13 +1271,16 @@
-khtml-border-radius: 4px; -khtml-border-radius: 4px;
border-radius: 4px; border-radius: 4px;
} }
.swagger-section #header form#api_selector .input a#explore:hover { .swagger-section #explore:hover {
background-color: #547f00; background-color: #547f00;
} }
.swagger-section #header form#api_selector .input input { .swagger-section #header #logo {
font-size: 0.9em; font-size: 1.5em;
padding: 3px; font-weight: bold;
margin: 0; text-decoration: none;
background: transparent url(../images/logo_small.png) no-repeat left center;
padding: 20px 0 20px 40px;
color: white;
} }
.swagger-section #content_message { .swagger-section #content_message {
margin: 10px 15px; margin: 10px 15px;

View File

@@ -53,7 +53,8 @@
clientSecret: "your-client-secret-if-required", clientSecret: "your-client-secret-if-required",
realm: "your-realms", realm: "your-realms",
appName: "your-app-name", appName: "your-app-name",
scopeSeparator: "," scopeSeparator: ",",
additionalQueryStringParams: {}
}); });
} }
@@ -73,6 +74,7 @@
docExpansion: "none", docExpansion: "none",
jsonEditor:true, jsonEditor:true,
apisSorter: "alpha", apisSorter: "alpha",
defaultModelRendering: 'schema',
showRequestHeaders: false showRequestHeaders: false
}); });

View File

@@ -14,7 +14,12 @@ window.SwaggerUi = Backbone.Router.extend({
// SwaggerUi accepts all the same options as SwaggerApi // SwaggerUi accepts all the same options as SwaggerApi
initialize: function(options) { initialize: function(options) {
options = options || {}; options = options || {};
if(!options.highlightSizeThreshold) {
if (options.defaultModelRendering !== 'model') {
options.defaultModelRendering = 'schema';
}
if (!options.highlightSizeThreshold) {
options.highlightSizeThreshold = 100000; options.highlightSizeThreshold = 100000;
} }
@@ -187,7 +192,7 @@ window.SwaggerUi = Backbone.Router.extend({
var $msgbar = $('#message-bar'); var $msgbar = $('#message-bar');
$msgbar.removeClass('message-fail'); $msgbar.removeClass('message-fail');
$msgbar.addClass('message-success'); $msgbar.addClass('message-success');
$msgbar.html(data); $msgbar.text(data);
if(window.SwaggerTranslator) { if(window.SwaggerTranslator) {
window.SwaggerTranslator.translate($msgbar); window.SwaggerTranslator.translate($msgbar);
} }

View File

@@ -108,23 +108,24 @@ window.Docs = {
Docs.expandEndpointListForResource(fragments[0]); Docs.expandEndpointListForResource(fragments[0]);
$("#"+dom_id).slideto({highlight: false}); $("#"+dom_id).slideto({highlight: false});
// Expand operation // Expand operation
var li_dom_id = fragments.join('_'); var li_dom_id = fragments.join('_');
var li_content_dom_id = li_dom_id + "_content"; var li_content_dom_id = li_dom_id + "_content";
Docs.expandOperation($('#'+li_content_dom_id)); Docs.expandOperation($('#'+li_content_dom_id));
$('#'+li_dom_id).slideto({highlight: false}); $('#'+li_dom_id).slideto({highlight: false});
break; break;
} }
}, },
toggleEndpointListForResource: function(resource) { toggleEndpointListForResource: function(resource) {
var elem = $('li#resource_' + Docs.escapeResourceName(resource) + ' ul.endpoints'); var elem = $('li#resource_' + Docs.escapeResourceName(resource) + ' ul.endpoints');
if (elem.is(':visible')) { if (elem.is(':visible')) {
$.bbq.pushState('#/', 2);
Docs.collapseEndpointListForResource(resource); Docs.collapseEndpointListForResource(resource);
} else { } else {
$.bbq.pushState('#/' + resource, 2);
Docs.expandEndpointListForResource(resource); Docs.expandEndpointListForResource(resource);
} }
}, },

View File

@@ -8,7 +8,8 @@ Handlebars.registerHelper('sanitize', function(html) {
Handlebars.registerHelper('renderTextParam', function(param) { Handlebars.registerHelper('renderTextParam', function(param) {
var result, type = 'text', idAtt = ''; var result, type = 'text', idAtt = '';
var isArray = param.type.toLowerCase() === 'array' || param.allowMultiple; var paramType = param.type || param.schema.type || '';
var isArray = paramType.toLowerCase() === 'array' || param.allowMultiple;
var defaultValue = isArray && Array.isArray(param.default) ? param.default.join('\n') : param.default; var defaultValue = isArray && Array.isArray(param.default) ? param.default.join('\n') : param.default;
var dataVendorExtensions = Object.keys(param).filter(function(property) { var dataVendorExtensions = Object.keys(param).filter(function(property) {
@@ -31,6 +32,8 @@ Handlebars.registerHelper('renderTextParam', function(param) {
idAtt = ' id=\'' + param.valueId + '\''; idAtt = ' id=\'' + param.valueId + '\'';
} }
defaultValue = defaultValue.replace(/'/g,'&apos;');
if(isArray) { if(isArray) {
result = '<textarea class=\'body-textarea' + (param.required ? ' required' : '') + '\' name=\'' + param.name + '\'' + idAtt + dataVendorExtensions; result = '<textarea class=\'body-textarea' + (param.required ? ' required' : '') + '\' name=\'' + param.name + '\'' + idAtt + dataVendorExtensions;
result += ' placeholder=\'Provide multiple values in new lines' + (param.required ? ' (at least one required).' : '.') + '\'>'; result += ' placeholder=\'Provide multiple values in new lines' + (param.required ? ' (at least one required).' : '.') + '\'>';

View File

@@ -20,9 +20,10 @@ SwaggerUi.Views.BasicAuthButton = Backbone.View.extend({
'click #apply_basic_auth' : 'applyPassword' 'click #apply_basic_auth' : 'applyPassword'
}, },
applyPassword: function(){ applyPassword: function(event){
var username = $('.input_username').val(); event.preventDefault();
var password = $('.input_password').val(); var username = $('#input_username').val();
var password = $('#input_password').val();
var basicAuth = new SwaggerClient.PasswordAuthorization('basic', username, password); var basicAuth = new SwaggerClient.PasswordAuthorization('basic', username, password);
this.router.api.clientAuthorizations.add(this.model.type, basicAuth); this.router.api.clientAuthorizations.add(this.model.type, basicAuth);
this.router.load(); this.router.load();

View File

@@ -19,6 +19,14 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
this.parentId = this.model.parentId; this.parentId = this.model.parentId;
this.nickname = this.model.nickname; this.nickname = this.model.nickname;
this.model.encodedParentId = encodeURIComponent(this.parentId); this.model.encodedParentId = encodeURIComponent(this.parentId);
if (opts.swaggerOptions) {
this.model.defaultRendering = opts.swaggerOptions.defaultModelRendering;
if (opts.swaggerOptions.showRequestHeaders) {
this.model.showRequestHeaders = true;
}
}
return this; return this;
}, },
@@ -160,6 +168,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
value = successResponse[key]; value = successResponse[key];
this.model.successCode = key; this.model.successCode = key;
if (typeof value === 'object' && typeof value.createJSONSample === 'function') { if (typeof value === 'object' && typeof value.createJSONSample === 'function') {
this.model.successDescription = value.description;
signatureModel = { signatureModel = {
sampleJSON: JSON.stringify(value.createJSONSample(), void 0, 2), sampleJSON: JSON.stringify(value.createJSONSample(), void 0, 2),
isParam: false, isParam: false,
@@ -174,12 +183,9 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
signature: this.model.responseClassSignature signature: this.model.responseClassSignature
}; };
} }
var opts = this.options.swaggerOptions;
if (opts.showRequestHeaders) {
this.model.showRequestHeaders = true;
}
$(this.el).html(Handlebars.templates.operation(this.model)); $(this.el).html(Handlebars.templates.operation(this.model));
if (signatureModel) { if (signatureModel) {
signatureModel.defaultRendering = this.model.defaultRendering;
responseSignatureView = new SwaggerUi.Views.SignatureView({ responseSignatureView = new SwaggerUi.Views.SignatureView({
model: signatureModel, model: signatureModel,
router: this.router, router: this.router,
@@ -238,7 +244,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
addParameter: function(param, consumes) { addParameter: function(param, consumes) {
// Render a parameter // Render a parameter
param.consumes = consumes; param.consumes = consumes;
param.defaultRendering = this.model.defaultRendering;
// Copy this param JSON spec so that it will be available for JsonEditor // Copy this param JSON spec so that it will be available for JsonEditor
if(param.schema){ if(param.schema){
@@ -256,7 +262,6 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
param.schema.title = ' '; param.schema.title = ' ';
} }
} }
var paramView = new SwaggerUi.Views.ParameterView({ var paramView = new SwaggerUi.Views.ParameterView({
model: param, model: param,
@@ -269,6 +274,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
addStatusCode: function(statusCode) { addStatusCode: function(statusCode) {
// Render status codes // Render status codes
statusCode.defaultRendering = this.model.defaultRendering;
var statusCodeView = new SwaggerUi.Views.StatusCodeView({ var statusCodeView = new SwaggerUi.Views.StatusCodeView({
model: statusCode, model: statusCode,
tagName: 'tr', tagName: 'tr',
@@ -673,8 +679,8 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
$('.response_throbber', $(this.el)).hide(); $('.response_throbber', $(this.el)).hide();
//adds curl output // adds curl output
var curlCommand = this.model.asCurl(this.map); var curlCommand = this.model.asCurl(this.map, {responseContentType: contentType});
curlCommand = curlCommand.replace('!', '&#33;'); curlCommand = curlCommand.replace('!', '&#33;');
$( 'div.curl', $(this.el)).html('<pre>' + curlCommand + '</pre>'); $( 'div.curl', $(this.el)).html('<pre>' + curlCommand + '</pre>');
@@ -701,11 +707,10 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
toggleOperationContent: function (event) { toggleOperationContent: function (event) {
var elem = $('#' + Docs.escapeResourceName(this.parentId + '_' + this.nickname + '_content')); var elem = $('#' + Docs.escapeResourceName(this.parentId + '_' + this.nickname + '_content'));
if (elem.is(':visible')){ if (elem.is(':visible')){
event.preventDefault();
$.bbq.pushState('#/', 2); $.bbq.pushState('#/', 2);
event.preventDefault();
Docs.collapseOperation(elem); Docs.collapseOperation(elem);
} else { } else {
event.preventDefault();
Docs.expandOperation(elem); Docs.expandOperation(elem);
} }
}, },

View File

@@ -49,7 +49,8 @@ SwaggerUi.Views.ParameterView = Backbone.View.extend({
var signatureModel = { var signatureModel = {
sampleJSON: this.model.sampleJSON, sampleJSON: this.model.sampleJSON,
isParam: true, isParam: true,
signature: this.model.signature signature: this.model.signature,
defaultRendering: this.model.defaultRendering
}; };
if (this.model.sampleJSON) { if (this.model.sampleJSON) {

View File

@@ -15,8 +15,12 @@ SwaggerUi.Views.SignatureView = Backbone.View.extend({
$(this.el).html(Handlebars.templates.signature(this.model)); $(this.el).html(Handlebars.templates.signature(this.model));
this.switchToSnippet(); if (this.model.defaultRendering === 'model') {
this.switchToDescription();
} else {
this.switchToSnippet();
}
this.isParam = this.model.isParam; this.isParam = this.model.isParam;
if (this.isParam) { if (this.isParam) {

View File

@@ -14,6 +14,7 @@ SwaggerUi.Views.StatusCodeView = Backbone.View.extend({
sampleJSON: JSON.stringify(this.router.api.models[this.model.responseModel].createJSONSample(), null, 2), sampleJSON: JSON.stringify(this.router.api.models[this.model.responseModel].createJSONSample(), null, 2),
isParam: false, isParam: false,
signature: this.router.api.models[this.model.responseModel].getMockSignature(), signature: this.router.api.models[this.model.responseModel].getMockSignature(),
defaultRendering: this.model.defaultRendering
}; };
var responseModelView = new SwaggerUi.Views.SignatureView({model: responseModel, tagName: 'div'}); var responseModelView = new SwaggerUi.Views.SignatureView({model: responseModel, tagName: 'div'});

View File

@@ -1,83 +1,72 @@
.swagger-section { .swagger-section {
.title { .title { font-style: bold; }
font-style: bold;
}
.secondary_form { .secondary_form { display: none; }
display: none;
}
.main_image { .main_image {
display: block; display: block;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
.oauth_body { .oauth_body {
margin-left: 100px; margin-left: 100px;
margin-right: 100px; margin-right: 100px;
} }
.oauth_submit { .oauth_submit { text-align: center; }
text-align: center;
}
.api-popup-dialog { .api-popup-dialog {
z-index: 10000; z-index: 10000;
position: absolute; position: absolute;
width: 500px; width: 500px;
background: #FFF; background: #FFF;
padding: 20px; padding: 20px;
border: 1px solid #ccc; border: 1px solid #ccc;
border-radius: 5px; border-radius: 5px;
display: none; display: none;
font-size: 13px; font-size: 13px;
color: #777; color: #777;
}
.api-popup-title{ .api-popup-dialog .api-popup-title {
font-size: 24px; font-size: 24px;
padding: 10px 0; padding: 10px 0;
} }
.api-popup-title{ .api-popup-dialog .api-popup-title {
font-size: 24px; font-size: 24px;
padding: 10px 0; padding: 10px 0;
} }
.api-popup-dialog .error-msg {
p.error-msg {
padding-left: 5px; padding-left: 5px;
padding-bottom: 5px; padding-bottom: 5px;
} }
button.api-popup-authbtn { .api-popup-dialog .api-popup-authbtn { height: 30px; }
height: 30px;
}
button.api-popup-cancel {
height: 30px;
}
}
.api-popup-scopes { .api-popup-dialog .api-popup-cancel { height: 30px; }
padding: 10px 20px;
li { .api-popup-scopes { padding: 10px 20px; }
.api-popup-scopes li {
padding: 5px 0; padding: 5px 0;
line-height: 20px; line-height: 20px;
} }
.api-scope-desc { .api-popup-scopes li input {
padding-left: 20px;
font-style: italic;
}
li input {
position: relative; position: relative;
top: 2px; top: 2px;
} }
}
.api-popup-actions {
padding-top: 10px;
}
.api-popup-scopes .api-scope-desc {
padding-left: 20px;
font-style: italic;
}
.api-popup-actions { padding-top: 10px; }
} }

View File

@@ -1,157 +1,159 @@
@import 'src/main/less/highlight_default.less'; @import 'src/main/less/highlight_default.less';
@import 'src/main/less/specs.less'; @import 'src/main/less/specs.less';
@import 'src/main/less/auth.less'; @import 'src/main/less/auth.less';
.swagger-section { .swagger-section {
.access { .access { float: right; }
float: right;
}
.auth { .auth { float: right; }
float: right;
}
.api-ic { .api-ic {
height: 18px; height: 18px;
vertical-align: middle; vertical-align: middle;
display: inline-block; display: inline-block;
background: url(../images/explorer_icons.png) no-repeat; background: url(../images/explorer_icons.png) no-repeat;
.api_information_panel { }
position: relative;
margin-top: 20px;
margin-left: -5px;
background: #FFF;
border: 1px solid #ccc;
border-radius: 5px;
display: none;
font-size: 13px;
max-width: 300px;
line-height: 30px;
color: black;
padding: 5px;
p {
.api-msg-enabled {
color: green;
}
.api-msg-disabled {
color: red;
}
}
}
}
.api-ic:hover { .api-ic .api_information_panel {
.api_information_panel { position: relative;
position: absolute; margin-top: 20px;
display: block; margin-left: -5px;
} background: #FFF;
} border: 1px solid #ccc;
border-radius: 5px;
display: none;
font-size: 13px;
max-width: 300px;
line-height: 30px;
color: black;
padding: 5px;
}
.ic-info { .api-ic .api_information_panel p .api-msg-enabled { color: green; }
.api-ic .api_information_panel p .api-msg-disabled { color: red; }
.api-ic:hover .api_information_panel {
position: absolute;
display: block;
}
.ic-info {
background-position: 0 0; background-position: 0 0;
width: 18px; width: 18px;
margin-top: -6px; margin-top: -6px;
margin-left: 4px; margin-left: 4px;
} }
.ic-warning {
.ic-warning {
background-position: -60px 0; background-position: -60px 0;
width: 18px; width: 18px;
margin-top: -6px; margin-top: -6px;
margin-left: 4px; margin-left: 4px;
} }
.ic-error {
.ic-error {
background-position: -30px 0; background-position: -30px 0;
width: 18px; width: 18px;
margin-top: -6px; margin-top: -6px;
margin-left: 4px; margin-left: 4px;
} }
.ic-off {
.ic-off {
background-position: -90px 0; background-position: -90px 0;
width: 58px; width: 58px;
margin-top: -4px; margin-top: -4px;
cursor: pointer; cursor: pointer;
} }
.ic-on {
.ic-on {
background-position: -160px 0; background-position: -160px 0;
width: 58px; width: 58px;
margin-top: -4px; margin-top: -4px;
cursor: pointer; cursor: pointer;
} }
#header { #header {
background-color: #89bf04; background-color: #89bf04;
padding: 14px; padding: 14px;
a#logo { }
font-size: 1.5em;
font-weight: bold;
text-decoration: none;
background: transparent url(../images/logo_small.png) no-repeat left center;
padding: 20px 0 20px 40px;
color: white;
}
form#api_selector {
display: block;
clear: none;
float: right;
.input {
display: block;
clear: none;
float: left;
margin: 0 10px 0 0;
input#input_apiKey {
width: 200px;
}
input#input_baseUrl {
width: 400px;
}
a#explore {
display: block;
text-decoration: none;
font-weight: bold;
padding: 6px 8px;
font-size: 0.9em;
color: white;
background-color: #547f00;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
-o-border-radius: 4px;
-ms-border-radius: 4px;
-khtml-border-radius: 4px;
border-radius: 4px;
}
a#explore:hover {
background-color: #547f00;
}
input {
font-size: 0.9em;
padding: 3px;
margin: 0;
}
}
}
}
#content_message { #input_baseUrl { width: 400px; }
#api_selector {
display: block;
clear: none;
float: right;
}
#api_selector .input {
display: block;
clear: none;
float: left;
margin: 0 10px 0 0;
}
#api_selector input {
font-size: 0.9em;
padding: 3px;
margin: 0;
}
#input_apiKey { width: 200px; }
#explore {
display: block;
text-decoration: none;
font-weight: bold;
padding: 6px 8px;
font-size: 0.9em;
color: white;
background-color: #547f00;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
-o-border-radius: 4px;
-ms-border-radius: 4px;
-khtml-border-radius: 4px;
border-radius: 4px;
&:hover { background-color: #547f00; }
}
#header #logo {
font-size: 1.5em;
font-weight: bold;
text-decoration: none;
background: transparent url(../images/logo_small.png) no-repeat left center;
padding: 20px 0 20px 40px;
color: white;
}
#content_message {
margin: 10px 15px; margin: 10px 15px;
font-style: italic; font-style: italic;
color: #999999; color: #999999;
} }
#message-bar { #message-bar {
min-height: 30px; min-height: 30px;
text-align: center; text-align: center;
padding-top: 10px; padding-top: 10px;
} }
.swagger-collapse:before { .swagger-collapse:before {
content: "-"; content: "-";
} }
.swagger-expand:before {
content: "+";
}
.swagger-expand:before {
content: "+";
}
} }

View File

@@ -2,7 +2,7 @@
<select name="contentType" id="{{contentTypeId}}"> <select name="contentType" id="{{contentTypeId}}">
{{#if produces}} {{#if produces}}
{{#each produces}} {{#each produces}}
<option value="{{{this}}}">{{{this}}}</option> <option value="{{this}}">{{{this}}}</option>
{{/each}} {{/each}}
{{else}} {{else}}
<option value="application/json">application/json</option> <option value="application/json">application/json</option>

View File

@@ -18,10 +18,10 @@
</div> </div>
<div class='content' id='{{parentId}}_{{nickname}}_content' style='display:none'> <div class='content' id='{{parentId}}_{{nickname}}_content' style='display:none'>
{{#if deprecated}} {{#if deprecated}}
<h4>Warning: Deprecated</h4> <h4><span data-sw-translate>Warning: Deprecated</span></h4>
{{/if}} {{/if}}
{{#if description}} {{#if description}}
<h4>Implementation Notes</h4> <h4><span data-sw-translate>Implementation Notes</span></h4>
<div class="markdown">{{{description}}}</div> <div class="markdown">{{{description}}}</div>
{{/if}} {{/if}}
{{#oauth}} {{#oauth}}
@@ -42,9 +42,11 @@
{{/oauth}} {{/oauth}}
{{#if type}} {{#if type}}
<h4><span data-sw-translate>Response Class</span> (<span data-sw-translate>Status</span> {{successCode}})</h4> <h4><span data-sw-translate>Response Class</span> (<span data-sw-translate>Status</span> {{successCode}})</h4>
{{#if successDescription}}<div class="markdown">{{{successDescription}}}</div>{{/if}}
<p><span class="model-signature" /></p> <p><span class="model-signature" /></p>
<br/> <br/>
<div class="response-content-type" /> <div class="response-content-type" />
{{/if}} {{/if}}
<form accept-charset='UTF-8' class='sandbox'> <form accept-charset='UTF-8' class='sandbox'>
<div style='margin:0;padding:0;display:inline'></div> <div style='margin:0;padding:0;display:inline'></div>
@@ -78,7 +80,6 @@
</tr> </tr>
</thead> </thead>
<tbody class="operation-status"> <tbody class="operation-status">
</tbody> </tbody>
</table> </table>
{{/if}} {{/if}}

View File

@@ -2,6 +2,7 @@
<td> <td>
{{#if isBody}} {{#if isBody}}
<textarea class='body-textarea' readonly='readonly' name='{{name}}' id='{{valueId}}'>{{default}}</textarea> <textarea class='body-textarea' readonly='readonly' name='{{name}}' id='{{valueId}}'>{{default}}</textarea>
<div class="parameter-content-type" />
{{else}} {{else}}
{{#if default}} {{#if default}}
{{default}} {{default}}

View File

@@ -2,7 +2,7 @@
<select name="parameterContentType" id="{{parameterContentTypeId}}"> <select name="parameterContentType" id="{{parameterContentTypeId}}">
{{#if consumes}} {{#if consumes}}
{{#each consumes}} {{#each consumes}}
<option value="{{{this}}}">{{{this}}}</option> <option value="{{this}}">{{{this}}}</option>
{{/each}} {{/each}}
{{else}} {{else}}
<option value="application/json">application/json</option> <option value="application/json">application/json</option>

View File

@@ -2,7 +2,7 @@
<select name="responseContentType" id="{{responseContentTypeId}}"> <select name="responseContentType" id="{{responseContentTypeId}}">
{{#if produces}} {{#if produces}}
{{#each produces}} {{#each produces}}
<option value="{{{this}}}">{{{this}}}</option> <option value="{{this}}">{{{this}}}</option>
{{/each}} {{/each}}
{{else}} {{else}}
<option value="application/json">application/json</option> <option value="application/json">application/json</option>