about the node-red-node-swagger

309 views
Skip to first unread message

Michael Qiu

unread,
Oct 25, 2016, 1:38:24 PM10/25/16
to Node-RED
So I was trying out node-red-node-swagger on my machine, but as I follow the instruction under the github readme page, I was not able to generate the swagger doc as shown.

I am running the swagger node with Node...@0.14.6, nod...@4.4.7, n...@2.15.8.

The json file I see at  http://localhost:1880/http-api/swagger.json is: 

{"swagger":"2.0","info":{"title":"My Node-RED API","version":"0.0.1"},"basePath":"/","paths":{}}

And what I see in the swagger UI tab is 


Anybody has similar issues?



Sebastian Barwe

unread,
Oct 26, 2016, 10:52:13 AM10/26/16
to Node-RED
can you paste you flow here? no problems here with node swagger

Michael Qiu

unread,
Oct 26, 2016, 6:24:58 PM10/26/16
to Node-RED
sure, here is what I was messing with:


[{"id":"6b57012f.b4f4c","type":"http in","z":"529d5c0e.ce6ef4","name":"","url":"/","method":"get","swaggerDoc":"cd6b261e.7ca948","x":256,"y":249,"wires":[["6e870b2c.903a14"]]},{"id":"6e870b2c.903a14","type":"debug","z":"529d5c0e.ce6ef4","name":"","active":true,"console":"false","complete":"false","x":453,"y":285,"wires":[]},{"id":"cd6b261e.7ca948","type":"swagger-doc","z":"529d5c0e.ce6ef4","summary":"testing the swagger node","description":"*test*","tags":"testingTags","consumes":"/test","produces":"/result","parameters":[{"name":"itemNum","in":"query","description":"the item's identifier","required":false,"type":"integer"}],"responses":{"200":{"description":"200 action","schema":{"properties":{"200 action":{"type":"string"}}}},"400":{"description":"the request was malform","schema":{"properties":{"Error":{"type":"string"}}}}},"deprecated":false}]

Sebastian Barwe

unread,
Oct 27, 2016, 9:12:01 AM10/27/16
to Node-RED
You need to put in a "http output node"  and link it to your input node

Michael Qiu

unread,
Oct 27, 2016, 4:36:51 PM10/27/16
to Node-RED
ah ha! that was an easy fix! 
should probably update that in the readme doc.
Reply all
Reply to author
Forward
0 new messages