Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 52624 invoked from network); 21 Dec 2009 15:04:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Dec 2009 15:04:45 -0000 Received: (qmail 56800 invoked by uid 500); 21 Dec 2009 15:04:45 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 56716 invoked by uid 500); 21 Dec 2009 15:04:44 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 56706 invoked by uid 99); 21 Dec 2009 15:04:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Dec 2009 15:04:44 +0000 X-ASF-Spam-Status: No, hits=-10.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Dec 2009 15:04:38 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 169AF234C045 for ; Mon, 21 Dec 2009 07:04:18 -0800 (PST) Message-ID: <551630429.1261407858087.JavaMail.jira@brutus> Date: Mon, 21 Dec 2009 15:04:18 +0000 (UTC) From: "Joscha Feth (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Commented: (COUCHDB-604) _changes feed with ?feed=continuous does not return valid JSON In-Reply-To: <1095745989.1261389018068.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793225#action_12793225 ] Joscha Feth commented on COUCHDB-604: ------------------------------------- I know I am the "outsider" here, but I disagree - having a clean and valid interface is as much important as speed. +1 Vote for the flag (as this is both speedy and valid used with a SAX style parser). > _changes feed with ?feed=continuous does not return valid JSON > -------------------------------------------------------------- > > Key: COUCHDB-604 > URL: https://issues.apache.org/jira/browse/COUCHDB-604 > Project: CouchDB > Issue Type: Improvement > Components: HTTP Interface > Affects Versions: 0.10 > Reporter: Joscha Feth > Priority: Trivial > > When using the _changes interface via ?feed=continuous the JSON returned is rather > a stream of JSON documents than a valid JSON file itself: > {"seq":38,"id":"f473fe61a8a53778d91c38b23ed6e20f","changes":[{"rev":"9-d3e71c7f5f991b26fe014d884a27087f"}]} > {"seq":68,"id":"2a574814d61d9ec8a0ebbf43fa03d75b","changes":[{"rev":"6-67179f215e42d63092dc6b2199a3bf51"}],"deleted":true} > {"seq":70,"id":"75dbdacca8e475f5909e3cc298905ef8","changes":[{"rev":"1-0dee261a2bd4c7fb7f2abd811974d3f8"}]} > {"seq":71,"id":"09fb03236f80ea0680a3909c2d788e43","changes":[{"rev":"1-a9646389608c13a5c26f4c14c6863753"}]} > to be valid there needs to be a root element (and then an array with commata) like in the non-continuous feed: > {"results":[ > {"seq":38,"id":"f473fe61a8a53778d91c38b23ed6e20f","changes":[{"rev":"9-d3e71c7f5f991b26fe014d884a27087f"}]}, > {"seq":68,"id":"2a574814d61d9ec8a0ebbf43fa03d75b","changes":[{"rev":"6-67179f215e42d63092dc6b2199a3bf51"}],"deleted":true}, > {"seq":70,"id":"75dbdacca8e475f5909e3cc298905ef8","changes":[{"rev":"1-0dee261a2bd4c7fb7f2abd811974d3f8"}]}, > {"seq":71,"id":"09fb03236f80ea0680a3909c2d788e43","changes":[{"rev":"1-a9646389608c13a5c26f4c14c6863753"}]}, > in short this means that if someone does not parse the change events in an object like manner (e.g. waiting for a line-ending and then parsing the line), but using a SAX-like parser (throwing events of each new object, etc.) and expecting the response to be JSON (which it is not, because its not {x:[{},{},{}]} but {}{}{} which is not valid) there is an error thrown. > I can see, that people doing this line by line might be okay with the above approach, but the response is not valid JSON and it would be nice if there were a flag to make the response valid JSON. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.