Merge pull request #2 from swagger-api/master

update
This commit is contained in:
Канев Виталий
2015-05-16 15:40:15 +03:00
16 changed files with 163 additions and 74 deletions

View File

@@ -1,7 +1,7 @@
{ {
"name": "swagger-ui", "name": "swagger-ui",
"main": "dist/index.html", "main": "dist/index.html",
"version": "2.1.8-M1", "version": "2.1.5-M2",
"authors": [ "authors": [
"Mohsen Azimi <me@azimi.me>" "Mohsen Azimi <me@azimi.me>"
], ],

3
dist/css/print.css vendored
View File

@@ -1069,6 +1069,9 @@
.swagger-section .swagger-ui-wrap form.form_box p strong { .swagger-section .swagger-ui-wrap form.form_box p strong {
color: black; color: black;
} }
.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child {
padding-bottom: 0;
}
.swagger-section .title { .swagger-section .title {
font-style: bold; font-style: bold;
} }

3
dist/css/screen.css vendored
View File

@@ -1069,6 +1069,9 @@
.swagger-section .swagger-ui-wrap form.form_box p strong { .swagger-section .swagger-ui-wrap form.form_box p strong {
color: black; color: black;
} }
.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child {
padding-bottom: 0;
}
.swagger-section .title { .swagger-section .title {
font-style: bold; font-style: bold;
} }

2
dist/index.html vendored
View File

@@ -52,7 +52,7 @@
log("Unable to Load SwaggerUI"); log("Unable to Load SwaggerUI");
}, },
docExpansion: "none", docExpansion: "none",
sorter : "alpha" apisSorter: "alpha"
}); });
function addApiKeyAuthorization(){ function addApiKeyAuthorization(){

173
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

@@ -8,7 +8,7 @@
} }
], ],
"description": "Swagger UI is a dependency-free collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API", "description": "Swagger UI is a dependency-free collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API",
"version": "2.1.2-M2", "version": "2.1.5-M2",
"homepage": "http://swagger.io", "homepage": "http://swagger.io",
"license": "Apache 2.0", "license": "Apache 2.0",
"main": "dist/swagger-ui.js", "main": "dist/swagger-ui.js",
@@ -50,6 +50,6 @@
"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.4-M2" "swagger-client": "2.1.6-M2"
} }
} }

View File

@@ -1069,6 +1069,9 @@
.swagger-section .swagger-ui-wrap form.form_box p strong { .swagger-section .swagger-ui-wrap form.form_box p strong {
color: black; color: black;
} }
.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child {
padding-bottom: 0;
}
.swagger-section .title { .swagger-section .title {
font-style: bold; font-style: bold;
} }

View File

@@ -1069,6 +1069,9 @@
.swagger-section .swagger-ui-wrap form.form_box p strong { .swagger-section .swagger-ui-wrap form.form_box p strong {
color: black; color: black;
} }
.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child {
padding-bottom: 0;
}
.swagger-section .title { .swagger-section .title {
font-style: bold; font-style: bold;
} }

View File

@@ -52,7 +52,7 @@
log("Unable to Load SwaggerUI"); log("Unable to Load SwaggerUI");
}, },
docExpansion: "none", docExpansion: "none",
sorter : "alpha" apisSorter: "alpha"
}); });
function addApiKeyAuthorization(){ function addApiKeyAuthorization(){

View File

@@ -90,7 +90,9 @@ window.SwaggerUi = Backbone.Router.extend({
if (url && url.indexOf('http') !== 0) { if (url && url.indexOf('http') !== 0) {
url = this.buildUrl(window.location.href.toString(), url); url = this.buildUrl(window.location.href.toString(), url);
} }
if(this.api) {
this.options.authorizations = this.api.clientAuthorizations;
}
this.options.url = url; this.options.url = url;
this.headerView.update(url); this.headerView.update(url);

View File

@@ -24,7 +24,11 @@ Handlebars.registerHelper('renderTextParam', function(param) {
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).' : '.') + '\'>';
result += defaultValue + '</textarea>'; result += defaultValue + '</textarea>';
} else { } else {
result = '<input class=\'parameter\'' + (param.required ? ' class=\'required\'' : '') + ' minlength=\'' + (param.required ? 1 : 0) + '\''; var parameterClass = 'parameter';
if(param.required) {
parameterClass += ' required';
}
result = '<input class=\'' + parameterClass + '\' minlength=\'' + (param.required ? 1 : 0) + '\'';
result += ' name=\'' + param.name +'\' placeholder=\'' + (param.required ? '(required)' : '') + '\''; result += ' name=\'' + param.name +'\' placeholder=\'' + (param.required ? '(required)' : '') + '\'';
result += ' type=\'' + type + '\' value=\'' + defaultValue + '\'/>'; result += ' type=\'' + type + '\' value=\'' + defaultValue + '\'/>';
} }

View File

@@ -68,7 +68,7 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
} else { } else {
// Default validator // Default validator
if(window.location.protocol.startsWith('http')) { if(window.location.protocol.indexOf('http') === 0) {
this.model.validatorUrl = window.location.protocol + '//online.swagger.io/validator'; this.model.validatorUrl = window.location.protocol + '//online.swagger.io/validator';
} }
} }

View File

@@ -1085,6 +1085,10 @@
} }
} }
} }
.operation-status td.markdown > p:last-child {
padding-bottom: 0;
}
} }
} }

View File

@@ -24,6 +24,6 @@
{{/each}} {{/each}}
</select> </select>
</td> </td>
<td class="markdown">{{{description}}}</td> <td class="markdown">{{#if required}}<strong>{{/if}}{{{description}}}{{#if required}}</strong>{{/if}}</td>
<td>{{{paramType}}}</td> <td>{{{paramType}}}</td>
<td><span class="model-signature"></span></td> <td><span class="model-signature"></span></td>

View File

@@ -1,5 +1,5 @@
<td width='15%' class='code'>{{code}}</td> <td width='15%' class='code'>{{code}}</td>
<td>{{{message}}}</td> <td class="markdown">{{{message}}}</td>
<td width='50%'><span class="model-signature" /></td> <td width='50%'><span class="model-signature" /></td>
<td class="headers"> <td class="headers">
<table> <table>