Re: [apps-discuss] Question about URI template and expansion of an empty list

"Murray S. Kucherawy" <superuser@gmail.com> Mon, 08 April 2013 06:55 UTC

Return-Path: <superuser@gmail.com>
X-Original-To: apps-discuss@ietfa.amsl.com
Delivered-To: apps-discuss@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0BBA221F91A5 for <apps-discuss@ietfa.amsl.com>; Sun, 7 Apr 2013 23:55:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.765
X-Spam-Level:
X-Spam-Status: No, score=-2.765 tagged_above=-999 required=5 tests=[AWL=-1.833, BAYES_00=-2.599, HTML_MESSAGE=0.001, SARE_HTML_USL_OBFU=1.666]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yMgTMtOsMyrx for <apps-discuss@ietfa.amsl.com>; Sun, 7 Apr 2013 23:55:27 -0700 (PDT)
Received: from mail-pd0-f175.google.com (mail-pd0-f175.google.com [209.85.192.175]) by ietfa.amsl.com (Postfix) with ESMTP id 22CC921F91A2 for <apps-discuss@ietf.org>; Sun, 7 Apr 2013 23:55:27 -0700 (PDT)
Received: by mail-pd0-f175.google.com with SMTP id g10so2864296pdj.20 for <apps-discuss@ietf.org>; Sun, 07 Apr 2013 23:55:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=ii17lSLB7dBwC3G8mA6qwr+Yak+9XOL5VRoqyWXhsdA=; b=Y5vnP2Fzqd+ws67ujd2CAJ6jRrLU0W52nuYNsGj7rqDQUS+tceVoBn9Q3n/e5mBpGG MYaqnBBbPjIXwkWjSbdQLGPTDpMmLoQ2HdhoB2v/oBQqgEtDtdXNGn5KNuAjaNokblMb Y4eyQcP2Xurl8ePYsGMEWF6CnLgAnkMBosB1upJek4gttRbwlgw4OGl9toJ/pLIq1W4z rH2rrfwcVc8SovrNR4UPkMekpcDs672jbHiiRGR44pjfde/S27uBn3iuASGNK4kanl/K L4bw2u1ix26RuaoxAYNorcNc6pT2houv/kJd06YRXfoVTyRFzPtOmCrQJxH++jKZM0BX zrvQ==
MIME-Version: 1.0
X-Received: by 10.66.149.165 with SMTP id ub5mr34386493pab.87.1365404126483; Sun, 07 Apr 2013 23:55:26 -0700 (PDT)
Received: by 10.66.234.40 with HTTP; Sun, 7 Apr 2013 23:55:26 -0700 (PDT)
In-Reply-To: <51625870.8000906@berkeley.edu>
References: <CALcybBBXFDvAp1xpbi4=55Gq0QbfbTH7TV=1MTko7nNdtt-5WQ@mail.gmail.com> <CALcybBBcCTh8+RVWp5UW+2-s9EdKxdoeGdcq6+yGrGJk1nzP0w@mail.gmail.com> <51625870.8000906@berkeley.edu>
Date: Sun, 07 Apr 2013 23:55:26 -0700
Message-ID: <CAL0qLwYR+HknkVH5Y_jusqBv3=QbALFe=5t3FhYArNxzQYDPpQ@mail.gmail.com>
From: "Murray S. Kucherawy" <superuser@gmail.com>
To: Erik Wilde <dret@berkeley.edu>
Content-Type: multipart/alternative; boundary="047d7b6dbcb4ef1b4f04d9d3eb84"
Cc: IETF Apps Discuss <apps-discuss@ietf.org>
Subject: Re: [apps-discuss] Question about URI template and expansion of an empty list
X-BeenThere: apps-discuss@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: General discussion of application-layer protocols <apps-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/apps-discuss>
List-Post: <mailto:apps-discuss@ietf.org>
List-Help: <mailto:apps-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 08 Apr 2013 06:55:28 -0000

I'm inclined to think it's "X." for the same reason "X{.empty}" is "X.",
which is to say that an empty list, like an empty string, isn't undefined,
but there is indeed nothing to expand.

Either way, there may be grounds for an erratum here.  The RFC does talk
about handling empty strings, but not empty lists.  The closest is Section
3.2.1 which talks about "expansion of a defined, non-empty value", meaning
defined, empty values aren't explicitly covered in the prose as far as I
can see.

-MSK


On Sun, Apr 7, 2013 at 10:41 PM, Erik Wilde <dret@berkeley.edu> wrote:

> hello francis.
>
>
> On 2013-04-07 13:38 , Francis Galiegue wrote:
>
>> On Fri, Apr 5, 2013 at 8:39 PM, Francis Galiegue <fgaliegue@gmail.com>
>> wrote:
>>
>>> Let us say that there is a variable called "list", whose value is an
>>> empty list:
>>> list = []
>>> Now let us have this template:
>>> X{.list}
>>> Should the expansion be "X" or "X."? And, more importantly, why?
>>>
>> Any insights? I have read the spec by and large (RFC 6570) and still
>> cannot figure it out...
>>
>
> https://github.com/dret/**uritemplate-test/blob/master/**
> spec-examples-by-section.json<https://github.com/dret/uritemplate-test/blob/master/spec-examples-by-section.json>(line 234) says it's "X", but i am really interested in the "why"
> explanation as well. http://tools.ietf.org/html/**rfc6570#section-3.2.5<http://tools.ietf.org/html/rfc6570#section-3.2.5>says that "for each defined variable in the variable-list, append '.' to
> the result string and then perform variable expansion", and i cannot find
> any text saying that an empty list is considered to be undefined. i have
> read the spec recently and never looked at this particular case, but
> without looking at the test cases i would have said it has to be expanded
> to "X." and not "X".
>
> cheers,
>
> dret.
>
> --
> erik wilde | mailto:dret@berkeley.edu  -  tel:+1-510-2061079 |
>            | UC Berkeley  -  School of Information (ISchool) |
>            | http://dret.net/netdret http://twitter.com/dret |
>
> ______________________________**_________________
> apps-discuss mailing list
> apps-discuss@ietf.org
> https://www.ietf.org/mailman/**listinfo/apps-discuss<https://www.ietf.org/mailman/listinfo/apps-discuss>
>