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

**URL:** <https://discourse.nodered.org/t/can-we-convert-the-json-of-our-node-red-workflow-into-any-specific-programming-language-or-into-swagger-doc/83276>\
**Category:** General\
**Created:** [29 November 2023 08:04 UTC](https://discourse.nodered.org/t/can-we-convert-the-json-of-our-node-red-workflow-into-any-specific-programming-language-or-into-swagger-doc/83276 "2023-11-29T08:04:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pranshta](https://avatars.discourse-cdn.com/v4/letter/p/4da419/32.png) [@pranshta](https://discourse.nodered.org/u/pranshta)\
**Post date:** [29 November 2023 08:04 UTC](https://discourse.nodered.org/t/can-we-convert-the-json-of-our-node-red-workflow-into-any-specific-programming-language-or-into-swagger-doc/83276/1 "2023-11-29T08:04:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [29 November 2023 08:25 UTC](https://discourse.nodered.org/t/can-we-convert-the-json-of-our-node-red-workflow-into-any-specific-programming-language-or-into-swagger-doc/83276/2 "2023-11-29T08:25:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pranshta](https://avatars.discourse-cdn.com/v4/letter/p/4da419/32.png) [@pranshta](https://discourse.nodered.org/u/pranshta)\
**Post date:** [29 November 2023 10:08 UTC](https://discourse.nodered.org/t/can-we-convert-the-json-of-our-node-red-workflow-into-any-specific-programming-language-or-into-swagger-doc/83276/3 "2023-11-29T10:08:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [29 November 2023 10:08 UTC](https://discourse.nodered.org/t/can-we-convert-the-json-of-our-node-red-workflow-into-any-specific-programming-language-or-into-swagger-doc/83276/4 "2023-11-29T10:08:38Z")

</div>

There are swagger nodes that will generate a swagger ui

[https://flows.nodered.org/search?term=swagger](https://flows.nodered.org/search?term=swagger)

I have used [node-red-node-swagger](https://flows.nodered.org/node/node-red-node-swagger) some time ago - fairly certain it still works.

---

<div class="post-metadata">

**Author:** ![pranshta](https://avatars.discourse-cdn.com/v4/letter/p/4da419/32.png) [@pranshta](https://discourse.nodered.org/u/pranshta)\
**Post date:** [29 November 2023 10:25 UTC](https://discourse.nodered.org/t/can-we-convert-the-json-of-our-node-red-workflow-into-any-specific-programming-language-or-into-swagger-doc/83276/5 "2023-11-29T10:25:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [29 November 2023 17:13 UTC](https://discourse.nodered.org/t/can-we-convert-the-json-of-our-node-red-workflow-into-any-specific-programming-language-or-into-swagger-doc/83276/6 "2023-11-29T17:13:43Z")

</div>

> [@pranshta](#):
>
> generate my node-red api calls workflow into a specific programming language

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...

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [28 January 2024 17:14 UTC](https://discourse.nodered.org/t/can-we-convert-the-json-of-our-node-red-workflow-into-any-specific-programming-language-or-into-swagger-doc/83276/7 "2024-01-28T17:14:30Z")

</div>

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