Merge branch 'develop_2.0'
11
.gitattributes
vendored
@@ -1,4 +1,11 @@
|
|||||||
* text eol=lf
|
* text eol=lf
|
||||||
|
|
||||||
dist/**/* binary
|
dist/**/*.js binary
|
||||||
src/main/html/images/* binary
|
dist/**/*.map binary
|
||||||
|
dist/**/*.eot binary
|
||||||
|
dist/**/*.svg binary
|
||||||
|
dist/**/*.ttf binary
|
||||||
|
dist/**/*.woff binary
|
||||||
|
dist/**/*.woff2 binary
|
||||||
|
dist/**/*.png binary
|
||||||
|
dist/*.html text
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ The Swagger Specification has undergone 4 revisions since initial creation in 20
|
|||||||
|
|
||||||
Swagger UI Version | Release Date | Swagger Spec compatibility | Notes | Status
|
Swagger UI Version | Release Date | Swagger Spec compatibility | Notes | Status
|
||||||
------------------ | ------------ | -------------------------- | ----- | ------
|
------------------ | ------------ | -------------------------- | ----- | ------
|
||||||
2.1.0-M2 | 2015-03-28 | 1.1, 1.2, 2.0 | [master](https://github.com/swagger-api/swagger-ui) |
|
2.1.1-M2 | 2015-04-16 | 1.1, 1.2, 2.0 | [master](https://github.com/swagger-api/swagger-ui) |
|
||||||
2.0.24 | 2014-09-12 | 1.1, 1.2 | [tag v2.0.24](https://github.com/swagger-api/swagger-ui/tree/v2.0.24) |
|
2.0.24 | 2014-09-12 | 1.1, 1.2 | [tag v2.0.24](https://github.com/swagger-api/swagger-ui/tree/v2.0.24) |
|
||||||
1.0.13 | 2013-03-08 | 1.1, 1.2 | [tag v1.0.13](https://github.com/swagger-api/swagger-ui/tree/v1.0.13) |
|
1.0.13 | 2013-03-08 | 1.1, 1.2 | [tag v1.0.13](https://github.com/swagger-api/swagger-ui/tree/v1.0.13) |
|
||||||
1.0.1 | 2011-10-11 | 1.0, 1.1 | [tag v1.0.1](https://github.com/swagger-api/swagger-ui/tree/v1.0.1) |
|
1.0.1 | 2011-10-11 | 1.0, 1.1 | [tag v1.0.1](https://github.com/swagger-api/swagger-ui/tree/v1.0.1) |
|
||||||
|
|||||||
BIN
dist/images/explorer_icons.png
vendored
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
BIN
dist/images/favicon-16x16.png
vendored
|
Before Width: | Height: | Size: 645 B After Width: | Height: | Size: 644 B |
BIN
dist/images/favicon-32x32.png
vendored
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
BIN
dist/images/logo_small.png
vendored
|
Before Width: | Height: | Size: 770 B After Width: | Height: | Size: 769 B |
BIN
dist/images/pet_store_api.png
vendored
|
Before Width: | Height: | Size: 824 B After Width: | Height: | Size: 823 B |
BIN
dist/images/wordnik_api.png
vendored
|
Before Width: | Height: | Size: 980 B After Width: | Height: | Size: 979 B |
6
dist/index.html
vendored
@@ -42,9 +42,12 @@
|
|||||||
});
|
});
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
$('pre code').each(function(i, e) {
|
$('pre code').each(function(i, e) {
|
||||||
hljs.highlightBlock(e)
|
hljs.highlightBlock(e)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
addApiKeyAuthorization();
|
||||||
},
|
},
|
||||||
onFailure: function(data) {
|
onFailure: function(data) {
|
||||||
log("Unable to Load SwaggerUI");
|
log("Unable to Load SwaggerUI");
|
||||||
@@ -53,9 +56,8 @@
|
|||||||
sorter : "alpha"
|
sorter : "alpha"
|
||||||
});
|
});
|
||||||
|
|
||||||
function addApiKeyAuthorization() {
|
function addApiKeyAuthorization(){
|
||||||
var key = encodeURIComponent($('#input_apiKey')[0].value);
|
var key = encodeURIComponent($('#input_apiKey')[0].value);
|
||||||
log("key: " + key);
|
|
||||||
if(key && key.trim() != "") {
|
if(key && key.trim() != "") {
|
||||||
var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("api_key", key, "query");
|
var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("api_key", key, "query");
|
||||||
window.swaggerUi.api.clientAuthorizations.add("api_key", apiKeyAuth);
|
window.swaggerUi.api.clientAuthorizations.add("api_key", apiKeyAuth);
|
||||||
|
|||||||
2
dist/lib/swagger-oauth.js
vendored
@@ -277,7 +277,7 @@ window.onOAuthComplete = function onOAuthComplete(token) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
window.authorizations.add(oauth2KeyName, new ApiKeyAuthorization('Authorization', 'Bearer ' + b, 'header'));
|
window.swaggerUi.api.clientAuthorizations.add(oauth2KeyName, new SwaggerClient.ApiKeyAuthorization('Authorization', 'Bearer ' + b, 'header'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
59
dist/swagger-ui.js
vendored
14
dist/swagger-ui.min.js
vendored
@@ -277,7 +277,7 @@ window.onOAuthComplete = function onOAuthComplete(token) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
window.authorizations.add(oauth2KeyName, new ApiKeyAuthorization('Authorization', 'Bearer ' + b, 'header'));
|
window.swaggerUi.api.clientAuthorizations.add(oauth2KeyName, new SwaggerClient.ApiKeyAuthorization('Authorization', 'Bearer ' + b, 'header'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"email": "me@azimi.me"
|
"email": "me@azimi.me"
|
||||||
}],
|
}],
|
||||||
"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.0-M2",
|
"version": "2.1.1-M2",
|
||||||
"homepage": "http://swagger.io",
|
"homepage": "http://swagger.io",
|
||||||
"license": "Apache 2.0",
|
"license": "Apache 2.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -45,6 +45,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.0-M2"
|
"swagger-client": "2.1.2-M2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,9 +42,12 @@
|
|||||||
});
|
});
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
$('pre code').each(function(i, e) {
|
$('pre code').each(function(i, e) {
|
||||||
hljs.highlightBlock(e)
|
hljs.highlightBlock(e)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
addApiKeyAuthorization();
|
||||||
},
|
},
|
||||||
onFailure: function(data) {
|
onFailure: function(data) {
|
||||||
log("Unable to Load SwaggerUI");
|
log("Unable to Load SwaggerUI");
|
||||||
@@ -53,9 +56,8 @@
|
|||||||
sorter : "alpha"
|
sorter : "alpha"
|
||||||
});
|
});
|
||||||
|
|
||||||
function addApiKeyAuthorization() {
|
function addApiKeyAuthorization(){
|
||||||
var key = encodeURIComponent($('#input_apiKey')[0].value);
|
var key = encodeURIComponent($('#input_apiKey')[0].value);
|
||||||
log("key: " + key);
|
|
||||||
if(key && key.trim() != "") {
|
if(key && key.trim() != "") {
|
||||||
var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("api_key", key, "query");
|
var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("api_key", key, "query");
|
||||||
window.swaggerUi.api.clientAuthorizations.add("api_key", apiKeyAuth);
|
window.swaggerUi.api.clientAuthorizations.add("api_key", apiKeyAuth);
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Default validator
|
// Default validator
|
||||||
this.model.validatorUrl = 'http://online.swagger.io/validator';
|
this.model.validatorUrl = window.location.protocol + '//online.swagger.io/validator';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -325,7 +325,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
|||||||
// Note: This is compiled code
|
// Note: This is compiled code
|
||||||
// TODO: Refactor
|
// TODO: Refactor
|
||||||
handleFileUpload: function(map, form) {
|
handleFileUpload: function(map, form) {
|
||||||
var bodyParam, el, headerParams, l, len, len1, len2, len3, m, n, o, obj, p, param, params, ref1, ref2, ref3, ref4;
|
var bodyParam, el, headerParams, l, len, len1, len2, len3, m, n, o, p, param, params, ref1, ref2, ref3, ref4;
|
||||||
ref1 = form.serializeArray();
|
ref1 = form.serializeArray();
|
||||||
for (l = 0, len = ref1.length; l < len; l++) {
|
for (l = 0, len = ref1.length; l < len; l++) {
|
||||||
o = ref1[l];
|
o = ref1[l];
|
||||||
@@ -363,7 +363,9 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
|||||||
this.invocationUrl = this.model.supportHeaderParams() ? (headerParams = this.model.getHeaderParams(map), delete headerParams['Content-Type'], this.model.urlify(map, false)) : this.model.urlify(map, true);
|
this.invocationUrl = this.model.supportHeaderParams() ? (headerParams = this.model.getHeaderParams(map), delete headerParams['Content-Type'], this.model.urlify(map, false)) : this.model.urlify(map, true);
|
||||||
$('.request_url', $(this.el)).html('<pre></pre>');
|
$('.request_url', $(this.el)).html('<pre></pre>');
|
||||||
$('.request_url pre', $(this.el)).text(this.invocationUrl);
|
$('.request_url pre', $(this.el)).text(this.invocationUrl);
|
||||||
obj = {
|
|
||||||
|
// TODO: don't use jQuery. Use SwaggerJS for handling the call.
|
||||||
|
var obj = {
|
||||||
type: this.model.method,
|
type: this.model.method,
|
||||||
url: this.invocationUrl,
|
url: this.invocationUrl,
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
@@ -387,9 +389,6 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
|||||||
};
|
};
|
||||||
})(this)
|
})(this)
|
||||||
};
|
};
|
||||||
if (window.authorizations) {
|
|
||||||
window.authorizations.apply(obj);
|
|
||||||
}
|
|
||||||
jQuery.ajax(obj);
|
jQuery.ajax(obj);
|
||||||
return false;
|
return false;
|
||||||
// end of file-upload nastiness
|
// end of file-upload nastiness
|
||||||
@@ -594,6 +593,12 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
|||||||
code = $('<code />').html(_.escape(content));
|
code = $('<code />').html(_.escape(content));
|
||||||
pre = $('<pre class="xml" />').append(code);
|
pre = $('<pre class="xml" />').append(code);
|
||||||
|
|
||||||
|
// Plain Text
|
||||||
|
} else if (/text\/plain/.test(contentType)) {
|
||||||
|
code = $('<code />').text(content);
|
||||||
|
pre = $('<pre class="plain" />').append(code);
|
||||||
|
|
||||||
|
|
||||||
// Image
|
// Image
|
||||||
} else if (/^image\//.test(contentType)) {
|
} else if (/^image\//.test(contentType)) {
|
||||||
pre = $('<img>').attr('src', url);
|
pre = $('<img>').attr('src', url);
|
||||||
|
|||||||