pretty viewer for JSON response doesn't decode escape characters #924

Closed
farin opened this Issue Feb 18, 2015 · 10 comments

Comments

Projects
None yet
8 participants
@farin

farin commented Feb 18, 2015

Eg. raw json
{"links":[{"href":"http://localhost:5000/api_1_0/images","rel":"self"}]}

in pretty print, html link still contains escaping backslashes instead real text value
(according to json spec forward slashes can be escaped but it's not mandatory. Some libraries, like python ujson, produce jsons with such escape characters)

@farin farin changed the title from JSON reponse pretty viewer don't decode escape characters to pretty viewer for JSON response doesn't decode escape characters Feb 18, 2015

@ivan-novakov

This comment has been minimized.

Show comment
Hide comment
@ivan-novakov

ivan-novakov Mar 4, 2015

+1

It would be nice to have the option to "switch on/off" URL slash escaping.

+1

It would be nice to have the option to "switch on/off" URL slash escaping.

@bazted

This comment has been minimized.

Show comment
Hide comment
@bazted

bazted Mar 28, 2015

The most strange thing is that in Postman - REST Client(not packaged app) URL is parsed correctly and can be even clicked. It is strange that packaged app has this bug.

bazted commented Mar 28, 2015

The most strange thing is that in Postman - REST Client(not packaged app) URL is parsed correctly and can be even clicked. It is strange that packaged app has this bug.

@cameron-fgx

This comment has been minimized.

Show comment
Hide comment
@cameron-fgx

cameron-fgx Apr 1, 2015

+1

The issue isn't only on the "pretty" viewer, raw and preview are also escaped.

+1

The issue isn't only on the "pretty" viewer, raw and preview are also escaped.

@kevinvanmierlo

This comment has been minimized.

Show comment
Hide comment
@kevinvanmierlo

kevinvanmierlo Jul 3, 2015

+1

This is a thing that really bugs me

+1

This is a thing that really bugs me

@cnanney

This comment has been minimized.

Show comment
Hide comment
@cnanney

cnanney Jul 7, 2015

Yeah, "raw" is not really raw when displaying "Token":"oe0/18uk" as "Token":"oe0\/18uk"

cnanney commented Jul 7, 2015

Yeah, "raw" is not really raw when displaying "Token":"oe0/18uk" as "Token":"oe0\/18uk"

@abhijitkane

This comment has been minimized.

Show comment
Hide comment
@abhijitkane

abhijitkane Jul 7, 2015

Member

@cameron-fgx @cnanney What version of Postman are you on?

In 3.0.2, a server response of {"Token":"oe0/18uk"} is rendered as-is in the raw view and preview.

Member

abhijitkane commented Jul 7, 2015

@cameron-fgx @cnanney What version of Postman are you on?

In 3.0.2, a server response of {"Token":"oe0/18uk"} is rendered as-is in the raw view and preview.

@cnanney

This comment has been minimized.

Show comment
Hide comment
@cnanney

cnanney Jul 7, 2015

My mistake, this is not a Postman problem. Apparently the API is escaping forward slashes in the JSON response, so the actual value of oe0/18uk is being returned and displayed as oe0\/18uk in Postman raw and preview tab, and oe0\\/18uk in pretty.

When I use the "copy response" button from from any view, the escaping is removed and oe0/18uk is in my clipboard.

Is there a way for Postman to detect the escaped slashes and display it properly in the pretty tab? Raw should be the actual raw response, but in pretty can it unescape the slashes?

cnanney commented Jul 7, 2015

My mistake, this is not a Postman problem. Apparently the API is escaping forward slashes in the JSON response, so the actual value of oe0/18uk is being returned and displayed as oe0\/18uk in Postman raw and preview tab, and oe0\\/18uk in pretty.

When I use the "copy response" button from from any view, the escaping is removed and oe0/18uk is in my clipboard.

Is there a way for Postman to detect the escaped slashes and display it properly in the pretty tab? Raw should be the actual raw response, but in pretty can it unescape the slashes?

@a85 a85 added Bug Tentative labels Jul 9, 2015

@cnanney

This comment has been minimized.

Show comment
Hide comment
@cnanney

cnanney Jul 23, 2015

This is now worse in 3.0.5.

A response of {"Token":"oe0\/18uk"} is still displayed in all views as {"Token":"oe0\\/18uk"}, but is also now copying response to clipboard as {"Token":"oe0\\/18uk"}, where before it smartly removed all escaping nonsense and copied {"Token":"oe0/18uk"} to clipboard.

I think in Pretty and Preview view, it should properly unescape all these entities, so a\/e displays as a/e. Raw should always show the raw response. Same for copying to clipboard... If you copy from pretty/preview, it copies with the decoded escape characters, but raw copies the raw response.

cnanney commented Jul 23, 2015

This is now worse in 3.0.5.

A response of {"Token":"oe0\/18uk"} is still displayed in all views as {"Token":"oe0\\/18uk"}, but is also now copying response to clipboard as {"Token":"oe0\\/18uk"}, where before it smartly removed all escaping nonsense and copied {"Token":"oe0/18uk"} to clipboard.

I think in Pretty and Preview view, it should properly unescape all these entities, so a\/e displays as a/e. Raw should always show the raw response. Same for copying to clipboard... If you copy from pretty/preview, it copies with the decoded escape characters, but raw copies the raw response.

@abhijitkane

This comment has been minimized.

Show comment
Hide comment
@abhijitkane

abhijitkane Dec 29, 2015

Member

@cnanney Can you confirm this fixed in 3.2.8 of the app?

Member

abhijitkane commented Dec 29, 2015

@cnanney Can you confirm this fixed in 3.2.8 of the app?

@cnanney

This comment has been minimized.

Show comment
Hide comment
@cnanney

cnanney Dec 29, 2015

In 3.2.8 (packaged), this is resolved. I do notice that the "copy response to clipboard" button always produces the same output, rather than copying the raw response if you are viewing the raw tab when you press the button.

This is no big deal, because if you want the actual raw data, you can always just manually copy and paste it from the textarea.

cnanney commented Dec 29, 2015

In 3.2.8 (packaged), this is resolved. I do notice that the "copy response to clipboard" button always produces the same output, rather than copying the raw response if you are viewing the raw tab when you press the button.

This is no big deal, because if you want the actual raw data, you can always just manually copy and paste it from the textarea.

@a85 a85 added transfer and removed transfer labels Jan 27, 2016

@a85 a85 closed this Mar 30, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment