postmanlabs / postman-app-support

Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.
https://www.postman.com
5.84k stars 840 forks source link

Treat [ ... ] as JSON content #6528

Open mcandre opened 5 years ago

mcandre commented 5 years ago

Some REST services return raw JSON arrays ([ ... ]) rather than wrapping arrays in a standard JSON object ({ "derp": [ ... ] }). This leads to the Auto response format setting in Postman failing to render/prettyprint the response.

Fortunately, an explicit JSON setting has no trouble parsing this data and pretty printing it. So it's not the Postman JSON parser so much as the format identifier code that is found wanting.

shamasis commented 5 years ago

Yep. Agree.

shamasis commented 5 years ago

We need to use the following intents to decide on formatting:

  1. Content type
  2. Auto detection for small response sizes and maybe improve that too.
  3. User’s last selection