Can we convert the json of our node-red workflow into any specific programming language or into swagger doc

I want to generate my node-red api calls workflow into a specific programming language . We have that functionality in Postman, where we can do that . So do we have such thing in Node-Red or any suggestion would be great .
Thanks.

Not really used Swagger but is the document just YAML.
Have you looked at the YAML node. You can convert any JSON object to YAML.

but then YAML needs to be converted to specific programming language......

There are swagger nodes that will generate a swagger ui

https://flows.nodered.org/search?term=swagger

I have used node-red-node-swagger some time ago - fairly certain it still works.

Thanks Steve, I actually did explore the node-swagger , but the limitation with it is that we need to add the swagger-doc configuration for each node.
I am particularly looking for something which will the convert the whole workflow without adding any additional changes into the nodes

Hi Pranshta, do you mean the feature in Postman that re-writes your API request calls into another syntax, like curl or nodejs?

If so, then I suggest setting up requests in Postman to invoke your node-red api endpoints (for testing purposes) -- once that is working, use the <Code> option in Postman to generate the code you need to call it from your external programs.

Personally I love using node-red-node-swagger, as Steve suggested, to manually add my api/param configurations directly into my flows. It not only keeps the docs next to the implementation, but presents the endpoints as self-describing json that the Swagger UI can invoke directly. Great for testing flows without having to set up Postman!

And the best part is that the swagger definition is available from the node-red server itself (by default at http://localhost:1880/http-api/swagger.json) -- so you can import that url into Postman to kick-start your collection of requests...

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.