You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2017/11/10 17:30:23 UTC

[GitHub] lionelvillard closed pull request #81: fix issue #69

lionelvillard closed pull request #81: fix issue #69
URL: https://github.com/apache/incubator-openwhisk-client-js/pull/81
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/lib/routes.js b/lib/routes.js
index 2e5c214..b5a7dcd 100644
--- a/lib/routes.js
+++ b/lib/routes.js
@@ -43,10 +43,12 @@ class Routes extends BaseOperation {
   }
 
   create (options) {
-    const missing = CREATE_PARAMS.filter(param => !(options || {}).hasOwnProperty(param))
+    if (!options.hasOwnProperty('swagger')) {
+      const missing = CREATE_PARAMS.filter(param => !(options || {}).hasOwnProperty(param))
 
-    if (missing.length) {
-      throw new Error(`Missing mandatory parameters: ${missing.join(', ')}`)
+      if (missing.length) {
+        throw new Error(`Missing mandatory parameters: ${missing.join(', ')}`)
+      }
     }
 
     const body = this.route_swagger_definition(options)
@@ -55,6 +57,10 @@ class Routes extends BaseOperation {
   }
 
   route_swagger_definition (params) {
+    if (params.hasOwnProperty('swagger')) {
+      return { apidoc: { namespace: '_', swagger: params.swagger } }
+    } 
+
     const apidoc = {
       namespace: '_',
       gatewayBasePath: this.route_base_path(params),


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services