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:
[email protected]


With regards,
Apache Git Services

Reply via email to