Git Product home page Git Product logo

node-red-contrib-swagger's People

Contributors

cpedrinaci avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-red-contrib-swagger's Issues

TypeError: Cannot read property 'params' of undefined

With some updates to the node, I have managed to get the node to load successfully but I am not sure if it is actually working (Hence this issue - I will open PR with update soon as I know some people is having trouble loading this.)

When I use inject node with valid JSON to swagger-node I receive following error:

TypeError: Cannot read property 'params' of undefined

I have tried two different API specs. It seems that the client is not receiving the object it is looking for. Any one got any ideas what is wrong here?

Editing of Functions may not work

It's written on the Readme page.. but I would like to track the issue and get notifiyed..

Readme says:
This node makes indirectly use of Shred for handling http requests. Unfortunately this library seems to have a dependency issue with the Orion editing library which is used by the NodeRed's Function node to edit functions code. As a result the editing of Functions may not work (i.e., the form will not pop up) when this node is also under use. The functionality of both function nodes and swagger nodes still is ensured but it is certainly inconvenient not being able edit functions. We are currently looking into this to figure out a way around it.

ReferenceError: node is not defined

I installed the plugin to Node-RED v0.12.2, but once I open the UI I get the following exception and node-red stops:

Welcome to Node-RED
===================

20 Jan 18:10:32 - [info] Node-RED version: v0.12.2
20 Jan 18:10:32 - [info] Node.js  version: v5.4.1
20 Jan 18:10:32 - [info] Loading palette nodes
20 Jan 18:10:32 - [warn] ------------------------------------------
20 Jan 18:10:32 - [warn] [rpi-gpio] Info : Ignoring Raspberry Pi specific node
20 Jan 18:10:32 - [warn] [serialport] Error: Cannot find module '/usr/lib/node_modules/node-red/node_modules/node-red-node-serialport/node_modules/serialport/build/serialport/v1.7.4/Release/node-v47-linux-x64/serialport.node'
20 Jan 18:10:32 - [warn] ------------------------------------------
20 Jan 18:10:32 - [info] Settings file  : /home/user/.node-red/settings.js
20 Jan 18:10:32 - [info] User directory : /home/user/.node-red
20 Jan 18:10:32 - [info] Flows file : /home/user/.node-red/flows_localhost.localdomain.json
20 Jan 18:10:32 - [info] Server now running at http://127.0.0.1:1880/
20 Jan 18:10:32 - [info] Starting flows
20 Jan 18:10:32 - [info] Started flows
20 Jan 18:10:40 - [red] Uncaught Exception:
20 Jan 18:10:40 - ReferenceError: node is not defined
    at ReadFileContext.callback (/usr/lib/node_modules/node-red/node_modules/node-red-contrib-swagger/swagger/node-red-contrib-swagger.js:300:21)
    at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:324:13)

APIKey authorization header is missing when using SwaggerHub v2 definitions

I'm trying to connect to some server-side code generated from SwaggerHub, using swagger v2.0 syntax. While the server code seems to work fine, the client node only receives 403 denied responses, since the client never sends the X-API-Key in the request header. I believe this is a bug in this code that I just commented on (the scheme object has undefined "keyname" and "passAs" properties).

  switch(scheme.type) {
    case 'apiKey':
        node.swaggerClient.clientAuthorizations.add(scheme.name,
            new SwaggerClient.ApiKeyAuthorization(scheme.keyname, password, scheme.passAs));
        break;

The relevant securityDefinitions section of the swagger.json file looks like this:

  "securityDefinitions" : {
    "BasicAuth" : {
      "type" : "basic"
    },
    "ApiKeyAuth" : {
      "type" : "apiKey",
      "name" : "X-API-Key",
      "in" : "header"
    },
  },

Since every endpoint is using the same security key, the global security object is defined as:

  "security" : [ {
    "ApiKeyAuth" : [ ]
  } ],

Please let me know what is missing -- or how I can debug this missing header key!
__
Steve

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.