From df5b976b185f739a02fc711577c3a329e7c59fd5 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Sun, 10 May 2015 17:59:25 -0700 Subject: [PATCH 01/11] fix for #1257 --- src/main/javascript/helpers/handlebars.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/javascript/helpers/handlebars.js b/src/main/javascript/helpers/handlebars.js index 334647ee39f..226acc30bef 100644 --- a/src/main/javascript/helpers/handlebars.js +++ b/src/main/javascript/helpers/handlebars.js @@ -24,7 +24,11 @@ Handlebars.registerHelper('renderTextParam', function(param) { result += ' placeholder=\'Provide multiple values in new lines' + (param.required ? ' (at least one required).' : '.') + '\'>'; result += defaultValue + ''; } else { - result = ''; } From fc5da2cd07e7b78754931c7fcdc1c3a0a91ad590 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Wed, 13 May 2015 07:24:57 -0400 Subject: [PATCH 02/11] updated swagger-js, rebuilt --- bower.json | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bower.json b/bower.json index 4808bbafd6c..5b3275fd162 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "swagger-ui", "main": "dist/index.html", - "version": "2.1.8-M1", + "version": "2.1.3-M2", "authors": [ "Mohsen Azimi " ], diff --git a/package.json b/package.json index 4bd2a204758..244de23d3d5 100644 --- a/package.json +++ b/package.json @@ -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", - "version": "2.1.2-M2", + "version": "2.1.3-M2", "homepage": "http://swagger.io", "license": "Apache 2.0", "main": "dist/swagger-ui.js", @@ -50,6 +50,6 @@ "less": "^2.4.0", "mocha": "^2.1.0", "selenium-webdriver": "^2.45.0", - "swagger-client": "2.1.4-M2" + "swagger-client": "2.1.5-M2" } } From 649509429e7a2487d1a2c3669b08916aa427ac4a Mon Sep 17 00:00:00 2001 From: Matthias Le Brun Date: Wed, 13 May 2015 14:34:09 +0200 Subject: [PATCH 03/11] fixed MainView for ES5 browser. calling ES6 String.prototype.startWith doesn't work in all browsers yet. --- src/main/javascript/view/MainView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/javascript/view/MainView.js b/src/main/javascript/view/MainView.js index 0a19f4ff196..626df464fea 100644 --- a/src/main/javascript/view/MainView.js +++ b/src/main/javascript/view/MainView.js @@ -68,7 +68,7 @@ SwaggerUi.Views.MainView = Backbone.View.extend({ } else { // 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'; } } From 06ff656bca959316be06db5eca1e4c6bc346a906 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Wed, 13 May 2015 08:49:06 -0400 Subject: [PATCH 04/11] updated versions for patch release --- bower.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index 5b3275fd162..0a63c5ac16d 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "swagger-ui", "main": "dist/index.html", - "version": "2.1.3-M2", + "version": "2.1.4-M2", "authors": [ "Mohsen Azimi " ], diff --git a/package.json b/package.json index 244de23d3d5..33a85e01daf 100644 --- a/package.json +++ b/package.json @@ -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", - "version": "2.1.3-M2", + "version": "2.1.4-M2", "homepage": "http://swagger.io", "license": "Apache 2.0", "main": "dist/swagger-ui.js", From 31715a9033737f4625396cd9ee2626cdd62a7fec Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Wed, 13 May 2015 08:50:40 -0400 Subject: [PATCH 05/11] rebuilt From c7268e92f297f07cf2394c3025a7e80c6d843969 Mon Sep 17 00:00:00 2001 From: Nara Kasbergen Date: Wed, 13 May 2015 11:47:25 -0400 Subject: [PATCH 06/11] Use the correct new sorting parameter name --- src/main/html/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/html/index.html b/src/main/html/index.html index 5194dbc2deb..9429a58911e 100644 --- a/src/main/html/index.html +++ b/src/main/html/index.html @@ -52,7 +52,7 @@ log("Unable to Load SwaggerUI"); }, docExpansion: "none", - sorter : "alpha" + apisSorter: "alpha" }); function addApiKeyAuthorization(){ From d4c3af0ec01055c9e6687fa43e850a48e8f122f9 Mon Sep 17 00:00:00 2001 From: Nara Kasbergen Date: Wed, 13 May 2015 16:26:11 -0400 Subject: [PATCH 07/11] Fixes #1268 --- src/main/template/param_list.handlebars | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/template/param_list.handlebars b/src/main/template/param_list.handlebars index b9f9dd75cbe..6957122fde3 100644 --- a/src/main/template/param_list.handlebars +++ b/src/main/template/param_list.handlebars @@ -24,6 +24,6 @@ {{/each}} -{{{description}}} +{{#if required}}{{/if}}{{{description}}}{{#if required}}{{/if}} {{{paramType}}} From af5af9a59598edee2472f0d87a1a46b3a61d5ebc Mon Sep 17 00:00:00 2001 From: Nara Kasbergen Date: Wed, 13 May 2015 16:39:01 -0400 Subject: [PATCH 08/11] Fixes #1233 --- src/main/template/status_code.handlebars | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/template/status_code.handlebars b/src/main/template/status_code.handlebars index a0a6122e4f8..d6f288cae29 100644 --- a/src/main/template/status_code.handlebars +++ b/src/main/template/status_code.handlebars @@ -1,5 +1,5 @@ {{code}} -{{{message}}} +{{{message}}} From 310dd646c3c6a5e08b45097e64b587793428cab1 Mon Sep 17 00:00:00 2001 From: Nara Kasbergen Date: Wed, 13 May 2015 17:29:40 -0400 Subject: [PATCH 09/11] Just realized this adds some extra horizontal padding which may not be desirable, so this fixes that --- src/main/html/css/print.css | 3 +++ src/main/html/css/screen.css | 3 +++ src/main/less/specs.less | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/src/main/html/css/print.css b/src/main/html/css/print.css index a48f0585ab0..706b1ac4092 100644 --- a/src/main/html/css/print.css +++ b/src/main/html/css/print.css @@ -1069,6 +1069,9 @@ .swagger-section .swagger-ui-wrap form.form_box p strong { color: black; } +.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child { + padding-bottom: 0; +} .swagger-section .title { font-style: bold; } diff --git a/src/main/html/css/screen.css b/src/main/html/css/screen.css index ca381b9e7b6..9c312796c10 100644 --- a/src/main/html/css/screen.css +++ b/src/main/html/css/screen.css @@ -1069,6 +1069,9 @@ .swagger-section .swagger-ui-wrap form.form_box p strong { color: black; } +.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child { + padding-bottom: 0; +} .swagger-section .title { font-style: bold; } diff --git a/src/main/less/specs.less b/src/main/less/specs.less index 070de3ab8ba..850ca794796 100644 --- a/src/main/less/specs.less +++ b/src/main/less/specs.less @@ -1085,6 +1085,10 @@ } } } + + .operation-status td.markdown > p:last-child { + padding-bottom: 0; + } } } \ No newline at end of file From fdb264e1a9f233b8e1dca262b6610358e63189c8 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Thu, 14 May 2015 08:56:42 -0400 Subject: [PATCH 10/11] added authorizations --- src/main/javascript/SwaggerUi.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/javascript/SwaggerUi.js b/src/main/javascript/SwaggerUi.js index 7c3be6ca7fb..0b73f102a4c 100644 --- a/src/main/javascript/SwaggerUi.js +++ b/src/main/javascript/SwaggerUi.js @@ -90,7 +90,9 @@ window.SwaggerUi = Backbone.Router.extend({ if (url && url.indexOf('http') !== 0) { url = this.buildUrl(window.location.href.toString(), url); } - + if(this.api) { + this.options.authorizations = this.api.clientAuthorizations; + } this.options.url = url; this.headerView.update(url); From dfd1d931a98922d0180809870c32a032eae0e1df Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Thu, 14 May 2015 08:56:49 -0400 Subject: [PATCH 11/11] rebuilt --- bower.json | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bower.json b/bower.json index 0a63c5ac16d..e0c9fce4fbf 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "swagger-ui", "main": "dist/index.html", - "version": "2.1.4-M2", + "version": "2.1.5-M2", "authors": [ "Mohsen Azimi " ], diff --git a/package.json b/package.json index 33a85e01daf..75a58431e3a 100644 --- a/package.json +++ b/package.json @@ -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", - "version": "2.1.4-M2", + "version": "2.1.5-M2", "homepage": "http://swagger.io", "license": "Apache 2.0", "main": "dist/swagger-ui.js", @@ -50,6 +50,6 @@ "less": "^2.4.0", "mocha": "^2.1.0", "selenium-webdriver": "^2.45.0", - "swagger-client": "2.1.5-M2" + "swagger-client": "2.1.6-M2" } }