richardschneider / yappy

Yet another REST API server howling at the moon with JSON
MIT License
2 stars 0 forks source link

?pretty #143

Open richardschneider opened 8 years ago

richardschneider commented 8 years ago

A json response should be as terse #6 as possible (no CRLFs or unneeded whitespace). However for debugging purposes ?pretty=true should return "human readable" json.

richardschneider commented 7 years ago

Salesforce uses HTTP Header X-PrettyPrint: 1. Other's use Accept: application/json+pretty.

richardschneider commented 7 years ago

In express, pretty printing JSON is only settable at the app (not response) level. When https://github.com/expressjs/express/pull/2422 gets merged and released the above can be implemented.

Currently pretty printing is the default and cannot be turned off.