You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Postman app, without these code generators enabled, will escape the JSON body for a cURL request using single-quotes, which makes the body easily readable when copy/pasting the cURL example into docs or scripts. For example, here is what the normal Postman app might shoe for a cURL request that includes some JSON:
Note that it is using single-quotes to pass the Headers and Body content to the cURL command-line. As such, there is very little backslash escaping and readability is high. Furthermore, by not adding all the double-quote escapes to the JSON body content, I can copy/paste it directly into something else, since it is just JSON (and not JSON with a bunch of weird escaping, which is not valid JSON).
If I enable this experimental code generator, the result is decidedly less readable, since the code-generators cURL support chooses to use double-quotes, causing much more unnecessary escaping of the JSON:
If I copy/paste this JSON body content into jsonlint.com, you will see that it is no longer valid JSON due to all the extra backslash escaping.
As such, I'd like to revert the code-generators back to using the single-quote for sanitizing the headers and body content. I have a fix for this and will submit a pull request in the next couple weeks for review.
The text was updated successfully, but these errors were encountered:
The Postman app, without these code generators enabled, will escape the JSON body for a cURL request using single-quotes, which makes the body easily readable when copy/pasting the cURL example into docs or scripts. For example, here is what the normal Postman app might shoe for a cURL request that includes some JSON:
Note that it is using single-quotes to pass the Headers and Body content to the cURL command-line. As such, there is very little backslash escaping and readability is high. Furthermore, by not adding all the double-quote escapes to the JSON body content, I can copy/paste it directly into something else, since it is just JSON (and not JSON with a bunch of weird escaping, which is not valid JSON).
If I enable this experimental code generator, the result is decidedly less readable, since the code-generators cURL support chooses to use double-quotes, causing much more unnecessary escaping of the JSON:
If I copy/paste this JSON body content into jsonlint.com, you will see that it is no longer valid JSON due to all the extra backslash escaping.
As such, I'd like to revert the code-generators back to using the single-quote for sanitizing the headers and body content. I have a fix for this and will submit a pull request in the next couple weeks for review.
The text was updated successfully, but these errors were encountered: