openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mham...@apache.org
Subject [incubator-openwhisk-apigateway] branch 0.8.x updated: Fix swagger parse logic for empty execute policy (#238)
Date Fri, 30 Jun 2017 20:24:55 GMT
This is an automated email from the ASF dual-hosted git repository.

mhamann pushed a commit to branch 0.8.x
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-apigateway.git


The following commit(s) were added to refs/heads/0.8.x by this push:
     new c8cf541  Fix swagger parse logic for empty execute policy (#238)
c8cf541 is described below

commit c8cf541e3ed32f6b49350d5f9cf47b9dc05c36c3
Author: Alex Song <alexsong93@gmail.com>
AuthorDate: Thu Jun 29 15:29:09 2017 -0400

    Fix swagger parse logic for empty execute policy (#238)
---
 scripts/lua/management/lib/swagger.lua | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/scripts/lua/management/lib/swagger.lua b/scripts/lua/management/lib/swagger.lua
index 7184d42..c7d9951 100644
--- a/scripts/lua/management/lib/swagger.lua
+++ b/scripts/lua/management/lib/swagger.lua
@@ -41,9 +41,14 @@ function _M.parseSwagger(swagger)
     for verb, value in pairs(verbObj) do
       decoded.resources[path].operations[verb] = {}
       local verbObj = decoded.resources[path].operations[verb]
-      local backend = (backends["all"] ~= nil) and backends["all"] or backends[value.operationId]
-      verbObj.backendUrl = backend.backendUrl
-      verbObj.backendMethod = (backend.backendMethod == 'keep') and verb or backend.backendMethod
+      if backends ~= nil then
+        local backend = (backends["all"] ~= nil) and backends["all"] or backends[value.operationId]
+        verbObj.backendUrl = backend.backendUrl
+        verbObj.backendMethod = (backend.backendMethod == 'keep') and verb or backend.backendMethod
+      else
+        verbObj.backendUrl = ''
+        verbObj.backendMethod = verb
+      end
       verbObj.policies = policies
       verbObj.security = security
     end

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" <commits@openwhisk.apache.org>'].

Mime
View raw message