node-red / node-red-node-swagger

A set of tools for generating Swagger api documentation based on the HTTP nodes deployed in a flow
Apache License 2.0
63 stars 48 forks source link

Unable to load SwaggerUI #58

Closed faizulhassan closed 4 years ago

faizulhassan commented 6 years ago

Hi , I tried implementing Swagger following your instructions.

I have it installed correctly but my swagger.json throws the following error..

image

In the developer console I get the log as below:

image

Node-Red Log:

image

Node Structure:

.node-red --> node_module -->

Please help fix my problem..

Thank You!

faizulhassan commented 6 years ago

Managed to fix the above but now the UI in Swagger tab remains the same even after importing the http In node..

Swagger UI remains same even after trying various combinations of the http node.

Below is my node flow:


[{"id":"ac44da7e.5b7d38","type":"http in","z":"952022f4.3bcd9","name":"","url":"/test","method":"get","upload":false,"swaggerDoc":"4974c96.827c438","x":320,"y":140,"wires":[["2768f500.667aec","d33b2e0.5b574d"]]},{"id":"4974c96.827c438","type":"swagger-doc","z":"952022f4.3bcd9","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","name":"200 action","propertyRow":true}}},"code":"200"},"400":{"description":"the request was malform","schema":{"properties":{"Error":{"type":"string","name":"Error","propertyRow":true}}},"code":"400"}},"deprecated":false}]


Node Red , Swagger UI Screengrab:

image

Swagger.json screengrabs:

image

gchavepeyer commented 5 years ago

Hey FaizulHassan,

Any chance you got it fixed, I'm having the exact same issue :/

Regards, Geoffrey

knolleary commented 4 years ago

67 has been merged that should address this issue - version 0.1.9 of the node published to npm.