Compare commits

..
27 Commits
Author SHA1 Message Date
Tony Tam 631329fdfb rebuilt 2015-04-16 12:30:37 -07:00
Tony Tam 433c32a115 Merge branch 'develop_2.0' 2015-04-16 12:29:38 -07:00
Tony Tam 843e86b5cc merged with master 2015-04-16 12:29:26 -07:00
Tony Tam aadae973df rebuilt 2015-04-16 12:27:56 -07:00
Tony Tam 3963c3abe9 removed text files from binary attribute 2015-04-16 12:27:27 -07:00
Tony Tam 0aec2ab134 updated versions 2015-04-16 12:27:12 -07:00
Tony Tam 00d191e8c0 updated from master 2015-04-16 12:24:39 -07:00
Tony Tam f9fdb05fbe Merge pull request #1170 from swagger-api/apikeyfix
Add API Key auth in onComplete callback of SwaggerUI#load call
2015-04-15 14:48:05 -07:00
Mohsen Azimi b579783ba0 Add API Key auth in onComplete callback of SwaggerUI#load call 2015-04-15 14:46:32 -07:00
Tony Tam 0ab3370bc5 rebuilt 2015-04-15 12:27:09 -07:00
Tony Tam df35bfb538 Merge branch 'fix-1109' into develop_2.0 2015-04-15 12:26:43 -07:00
Tony Tam 3441403fda Merge branch 'develop_2.0' into fix-1109 2015-04-15 12:26:25 -07:00
Mohsen Azimi e6664851b3 Support plain text in response
Fixes #1109
Fixes #1111
2015-04-15 12:05:48 -07:00
Tony Tam 3c6d4ff3e6 rebuilt 2015-04-15 12:02:54 -07:00
Tony Tam 854ef16cbb Merge branch 'fix-1132' into develop_2.0 2015-04-15 12:00:40 -07:00
Tony Tam 6f8533bdc2 Merge branch 'develop_2.0' into fix-1132 2015-04-15 12:00:28 -07:00
Tony Tam 3148d3938c Merge branch 'fix-1160' into develop_2.0 2015-04-15 11:55:42 -07:00
Tony Tam 3a1e11fafc Merge branch 'develop_2.0' into fix-1160 2015-04-15 11:55:27 -07:00
Mohsen Azimi 53966f7aa8 Fix issue #1132 "JS error when testing uploadFile method (http://petstore.swagger.io/#!/pet/uploadFile)" 2015-04-14 14:01:38 -07:00
Mohsen Azimi 25af301e6d Merge pull request #1157 from neoecos/patch-2
Call to swaggerUi.load before possible use.
2015-04-14 13:38:02 -07:00
Mohsen Azimi a7d708593c Fix issue #1160 "piKey is not set when Explore button is clicked " 2015-04-14 13:30:55 -07:00
Tony Tam e0687b044d Merge pull request #1128 from shuisman/patch-2
Update default validator with correct protocol
2015-04-14 09:56:46 -07:00
Sebastian Ortiz 44f200542c Call to swaggerUi.load before possible use.
Using addApiKeyAuthorization function, needs to be done after swaggerUi is loaded, otherwise calling ``window.swaggerUi.api.clientAuthorizations.add`` will fail, and the authorization headers will not be aded.
2015-04-13 13:31:06 -05:00
Tony Tam 5d5606bb61 Merge pull request #1150 from OmniscientTechnology/develop_2.0
Fix - Swagger/Swashbuckle OAuth2 Authorizations not set #1134
2015-04-13 10:25:32 -07:00
Tony Tam 727812a544 updated client version 2015-04-11 07:14:16 -07:00
vprefournier 6761fd7a98 Fix - Swagger/Swashbuckle OAuth2 Authorizations not set #1134 2015-04-11 06:27:01 -04:00
shuisman e127bf3577 Update default validator with correct protocol
Current code defaults to http protocol, but when package is installed in a https environment, the default validator should be securely available.
2015-04-07 18:37:02 +02:00
11 changed files with 79 additions and 41 deletions
+9 -2
View File
@@ -1,4 +1,11 @@
* text eol=lf
dist/**/* binary
src/main/html/images/* binary
dist/**/*.js 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
+1 -1
View File
@@ -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
------------------ | ------------ | -------------------------- | ----- | ------
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) |
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) |
+4 -2
View File
@@ -42,9 +42,12 @@
});
*/
}
$('pre code').each(function(i, e) {
hljs.highlightBlock(e)
});
addApiKeyAuthorization();
},
onFailure: function(data) {
log("Unable to Load SwaggerUI");
@@ -53,9 +56,8 @@
sorter : "alpha"
});
function addApiKeyAuthorization() {
function addApiKeyAuthorization(){
var key = encodeURIComponent($('#input_apiKey')[0].value);
log("key: " + key);
if(key && key.trim() != "") {
var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("api_key", key, "query");
window.swaggerUi.api.clientAuthorizations.add("api_key", apiKeyAuth);
+1 -1
View File
@@ -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'));
}
}
}
+39 -17
View File
File diff suppressed because one or more lines are too long
+7 -7
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -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'));
}
}
}
+2 -2
View File
@@ -6,7 +6,7 @@
"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",
"version": "2.1.0-M2",
"version": "2.1.1-M2",
"homepage": "http://swagger.io",
"license": "Apache 2.0",
"scripts": {
@@ -45,6 +45,6 @@
"less": "^2.4.0",
"mocha": "^2.1.0",
"selenium-webdriver": "^2.45.0",
"swagger-client": "2.1.0-M2"
"swagger-client": "2.1.2-M2"
}
}
+4 -2
View File
@@ -42,9 +42,12 @@
});
*/
}
$('pre code').each(function(i, e) {
hljs.highlightBlock(e)
});
addApiKeyAuthorization();
},
onFailure: function(data) {
log("Unable to Load SwaggerUI");
@@ -53,9 +56,8 @@
sorter : "alpha"
});
function addApiKeyAuthorization() {
function addApiKeyAuthorization(){
var key = encodeURIComponent($('#input_apiKey')[0].value);
log("key: " + key);
if(key && key.trim() != "") {
var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("api_key", key, "query");
window.swaggerUi.api.clientAuthorizations.add("api_key", apiKeyAuth);
+1 -1
View File
@@ -68,7 +68,7 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
} else {
// Default validator
this.model.validatorUrl = 'http://online.swagger.io/validator';
this.model.validatorUrl = window.location.protocol + '//online.swagger.io/validator';
}
}
},
+10 -5
View File
@@ -325,7 +325,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
// Note: This is compiled code
// TODO: Refactor
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();
for (l = 0, len = ref1.length; l < len; 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);
$('.request_url', $(this.el)).html('<pre></pre>');
$('.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,
url: this.invocationUrl,
headers: headerParams,
@@ -387,9 +389,6 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
};
})(this)
};
if (window.authorizations) {
window.authorizations.apply(obj);
}
jQuery.ajax(obj);
return false;
// end of file-upload nastiness
@@ -594,6 +593,12 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
code = $('<code />').html(_.escape(content));
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
} else if (/^image\//.test(contentType)) {
pre = $('<img>').attr('src', url);