Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0EDC3105E7 for ; Thu, 21 Nov 2013 18:26:52 +0000 (UTC) Received: (qmail 77898 invoked by uid 500); 21 Nov 2013 18:26:47 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 76765 invoked by uid 500); 21 Nov 2013 18:26:39 -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 76699 invoked by uid 99); 21 Nov 2013 18:26:36 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Nov 2013 18:26:36 +0000 Date: Thu, 21 Nov 2013 18:26:36 +0000 (UTC) From: "Klaus Trainer (JIRA)" To: dev@couchdb.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (COUCHDB-1923) Allow ?attachments=true alongside ?include_docs=true on view 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-1923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13829191#comment-13829191 ] Klaus Trainer commented on COUCHDB-1923: ---------------------------------------- > The "include_attachments" suggestion was only consistent in this one > context, AFAICT all other uses of the same are simply "attachments" > and I'd personally prefer the latter. Using plural suggests that there are multiple instances of `attachments` query parameter usage. However, the `attachments` query parameter is currently used for only one API endpoint: `/:db/:docid`. [~natevw]: While first thinking that we can just reuse the `attachments` query parameter for other API endpoints as well, I came to the conclusion that it is better to introduce a new `include_attachments` query parameter for the following reasons. In the document API, attachments are sent with *one* particular requested document iff the query parameter value is `true`. Depending on whether a client requests the content type "application/json" (by setting the "Content-Type" header accordingly) or not, attachments are either included Base64-encoded in the document, or sent along as separate parts of the multipart response in their binary representation. In the view and changes API we got *a collection* of documents. Even if the `attachments` (whatsoever) query parameter value is `true`, no attachment contents will be sent unless the `include_docs` query parameter value is also `true`. That is, the effectiveness of the `attachments` query parameter depends on the presence and value of another query parameter here. Moreover, in contrast to the document API, attachments are always included Base64-encoded in the documents, and there are no multipart responses. Although there would be similar meaning, I don't think it would be a good idea to use the same query parameter name. Following the differences in semantics, it is consequential to use a different query parameter name. This makes the differences more explicit and therefore can help preventing users from having bad surprises. > Allow ?attachments=true alongside ?include_docs=true on view > ------------------------------------------------------------ > > Key: COUCHDB-1923 > URL: https://issues.apache.org/jira/browse/COUCHDB-1923 > Project: CouchDB > Issue Type: Improvement > Reporter: Nathan Vander Wilt > > I have a situation where it'd be handy to get inline [base64] attachments for the documents from a view response (already using include_docs=true). > I wonder if this is as easy a fix as COUCHDB-549 was? -- This message was sent by Atlassian JIRA (v6.1#6144)