# JSON to YAML conversion

**URL:** <https://community.postman.com/t/json-to-yaml-conversion/53964>\
**Category:** Help Hub\
**Tags:** documentation, collections, json, yaml\
**Created:** [October 27, 2023, 4:17am UTC](https://community.postman.com/t/json-to-yaml-conversion/53964 "2023-10-27T04:17:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nabeel\_ahmad](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/nabeel_ahmad/32/26334_2.png) [@nabeel\_ahmad](https://community.postman.com/u/nabeel_ahmad)\
**Post date:** [October 27, 2023, 4:17am UTC](https://community.postman.com/t/json-to-yaml-conversion/53964/1 "2023-10-27T04:17:11Z")

</div>

I have a json file and I want to convert it to yaml in Postman or will I have to use other tools to do that? Basically, I want to generate API Definitions of existing code files and I want to do that using Postman instead of going to some other software like Swagger.

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [October 27, 2023, 10:00am UTC](https://community.postman.com/t/json-to-yaml-conversion/53964/2 "2023-10-27T10:00:17Z")

</div>

Postman is built on Node.JS and the pre-request scripts and tests tab support JavaScript but you are limited to the libraries that are included in the sandbox.

The following link details what libraries are available.

[Manage API data and workflows using Postman JavaScript objects | Postman Learning Center](https://learning.postman.com/docs/writing-scripts/script-references/postman-sandbox-api-reference/#using-external-libraries)

The following blog explains how you can use external libraries using the JavaScript Eval function.

[Adding External Libraries in Postman | Postman Blog](https://blog.postman.com/adding-external-libraries-in-postman/)

The Eval function will only work with simple libraries that can run completely from the minified.js (and buyers beware as using Eval is a bit of a security risk, you need to ensure that the JavaScript you are evaluating is secure and tamper proof). Having a quick look, the only libraries that I could find for converting JSON to YAML were node.js libraries so I’m not sure you will find one than can run standalone.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [November 26, 2023, 10:00am UTC](https://community.postman.com/t/json-to-yaml-conversion/53964/3 "2023-11-26T10:00:49Z")

</div>

Closed on November 26, 2023, 10:00am UTC

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