On Aug 22, 2008, at 00:17, Christopher Lenz wrote:

On 21.08.2008, at 03:10, Noah Slater wrote:
On Wed, Aug 20, 2008 at 01:04:49PM -0500, Jason Huggins wrote:
I was thinking about creating a patch to add a "\n" at the end of
every request, but I figured that would be a request of last resort.

I did this very patch about 6 months ago but it was rejected and I can't quite remember why. Now that we're at the ASF I would like to call an informal vote.

Fellow committers, what say ye to adding a trailing \n to JSON output?

I think when you first brought this up, the patch would add a trailing newline to all responses, which would potentially corrupt binary responses such as for attachments.

If this is done for JSON responses only, I don't see any problems with adding a trailing newline.

[Not in direct response to this mail, but rather others on this thread:] Pretty-printing OTOH... I don't think it's worth it. This stuff isn't really intended for direct consumption by humans, and if you need prettified output, just post-process it with one of the bazillion available libs. Not something CouchDB should concern itself with.

I see the benefits, but:

[EMAIL PROTECTED] ~> curl -X GET http://localhost:5984/
{"couchdb":"Welcome","version":"0.8.0-incubating"[EMAIL PROTECTED] ~>
[EMAIL PROTECTED] ~>
[EMAIL PROTECTED] ~> ./ccurl.sh -X GET http://localhost:5984/
{"couchdb":"Welcome","version":"0.8.0-incubating"}
[EMAIL PROTECTED] ~> cat ccurl.sh
#/bin/sh
curl $@
echo ""[EMAIL PROTECTED] ~>

So this should be done on the client, in my opinion. Nothing stops
us from shipping a newlineadding and prettyprinting CouchDB client,
but i don't think that should be in the server.

Cheers
Jan
--

Reply via email to