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
62 stars 47 forks source link

Flags for unconfigured swagger doc in http nodes #18

Closed codymwalker closed 9 years ago

codymwalker commented 9 years ago

The following scenario has been brought up.

1) add HTTP In (say /path2) to canvas but don't Add/Edit the Doc settings (aka don't define any response codes)
2) wire in a function node and add an HTTP Out node
3) in swagger ui, you can test the API, but there is no definition of the expected response codes or output

If you have the swagger plugin enabled, and have http endpoints in your flows, but have not defined any additional documentation via the config, we use a placeholder in the swagger doc generation.

Should we present the user with a warning flag on the corresponding nodes, informing the user that they do not have any additional swagger doc attached?

This can be done in the swagger plugin itself, along with the check for http in nodes, that way we aren't changing the logic in the core nodes themselves.

Thoughts, @knolleary ?

codymwalker commented 9 years ago

Also, since this would be inside the swagger plugin, we wouldn't have to worry about the wrong people seeing it. If a user has the swagger plugin installed, a swagger related warning is pertinent to them.

drwoods commented 9 years ago

+1