From 77fc1c0adf384e29efa7bd243ac1db9b43088ae1 Mon Sep 17 00:00:00 2001 From: Rob Richardson Date: Wed, 17 Jun 2015 17:16:14 -0700 Subject: [PATCH 1/2] Spelling is hard --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 10758007..72b24643 100644 --- a/README.md +++ b/README.md @@ -225,7 +225,7 @@ Create your own fork of [swagger-api/swagger-ui](https://github.com/swagger-api/ To share your changes, [submit a pull request](https://github.com/swagger-api/swagger-ui/pull/new/develop_2.0). ## Change Log -Plsee see [releases](https://github.com/swagger-api/swagger-ui/releases) for change log. +Please see [releases](https://github.com/swagger-api/swagger-ui/releases) for change log. ## License From 128fc5c112c7c364d0e8e52533cf2c2e2895b058 Mon Sep 17 00:00:00 2001 From: Robert Brownstein Date: Fri, 19 Jun 2015 13:37:54 -0400 Subject: [PATCH 2/2] Found a bug in OperationView.js which caused the oAuth toggle to be displayed for non-oAuth endpoints if oAuth was enabled at all, fixed it --- src/main/javascript/view/OperationView.js | 29 ++++++++++++----------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/main/javascript/view/OperationView.js b/src/main/javascript/view/OperationView.js index d58e87e8..d4f940d9 100644 --- a/src/main/javascript/view/OperationView.js +++ b/src/main/javascript/view/OperationView.js @@ -95,22 +95,23 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({ for (l = 0, len = modelAuths.length; l < len; l++) { auths = modelAuths[l]; for (key in auths) { - auth = auths[key]; for (a in this.auths) { auth = this.auths[a]; - if (auth.type === 'oauth2') { - this.model.oauth = {}; - this.model.oauth.scopes = []; - ref1 = auth.value.scopes; - for (k in ref1) { - v = ref1[k]; - scopeIndex = auths[key].indexOf(k); - if (scopeIndex >= 0) { - o = { - scope: k, - description: v - }; - this.model.oauth.scopes.push(o); + if (key === auth.name) { + if (auth.type === 'oauth2') { + this.model.oauth = {}; + this.model.oauth.scopes = []; + ref1 = auth.value.scopes; + for (k in ref1) { + v = ref1[k]; + scopeIndex = auths[key].indexOf(k); + if (scopeIndex >= 0) { + o = { + scope: k, + description: v + }; + this.model.oauth.scopes.push(o); + } } } }