From 1bc499e3c415033195ee8bb25e9ec0cf7dc4ee0a Mon Sep 17 00:00:00 2001 From: Vlad Frolov Date: Sun, 13 Nov 2016 20:55:24 +0200 Subject: [PATCH] Fixed unnecessary scopes mutation The issue due to the mutated scopes popped up in Swagger-UI: https://github.com/swagger-api/swagger-ui/issues/2483 --- lib/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client.js b/lib/client.js index 518b428a5..9ea938bfc 100644 --- a/lib/client.js +++ b/lib/client.js @@ -310,7 +310,7 @@ SwaggerClient.prototype.buildFromSpec = function (response) { for(var ext in securityDefinition) { helpers.extractExtensions(ext, securityDefinition); if (ext === 'scopes') { - var scopes = securityDefinition[ext]; + var scopes = _.cloneDeep(securityDefinition[ext]); if(typeof scopes === 'object') { scopes.vendorExtensions = {}; for (var s in scopes) {