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

Joe Gregorio <joe@bitworking.org> Wed, 17 April 2013 14:03 UTC

Return-Path: <joe.gregorio@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 7915521F871C for <apps-discuss@ietfa.amsl.com>; Wed, 17 Apr 2013 07:03:21 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.978
X-Spam-Level:
X-Spam-Status: No, score=-1.978 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, NO_RELAYS=-0.001]
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 FralMmxXHYY4 for <apps-discuss@ietfa.amsl.com>; Wed, 17 Apr 2013 07:03:20 -0700 (PDT)
Received: from mail-ia0-x233.google.com (mail-ia0-x233.google.com [IPv6:2607:f8b0:4001:c02::233]) by ietfa.amsl.com (Postfix) with ESMTP id 504C521F8709 for <apps-discuss@ietf.org>; Wed, 17 Apr 2013 07:03:20 -0700 (PDT)
Received: by mail-ia0-f179.google.com with SMTP id l25so1450982iad.24 for <apps-discuss@ietf.org>; Wed, 17 Apr 2013 07:03:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=Dd6JNtyqtXyY3orxVGsbkwOvx0URlBeGmFa1qN0I/Ms=; b=x7Nezzz8h8zW1EWKMvSdobSukH5FgwXuNd6sJzS0Ywazs5SVe6b8wCans39SI9QGLL LIPwoGcbwn6D96bBwHTgXEPjqdcOBTIY+wdn/E+kUxNeJ/fDbNiMeBXRUTuwXRj8kRLD DkSHxWN/zlJy7wGYYUP1j7c158pv82psTtTmg+AlsUY2bMIQbou+7isM8ElQWvVnGH6/ pTStA8RyUGXF67OCxpZ9n6gbrQ7uPWXGvI7/A/8c4/KCRs6WtyGv+zgbZrUCQGpZtgg3 o7MBC7g8MjTp57GoXgUmxAryaK8sqDU6Ux0iHjNFArqdCgB/xqUgICXMHX3AeJusarpE 7azA==
MIME-Version: 1.0
X-Received: by 10.43.8.200 with SMTP id ot8mr3658430icb.11.1366207399597; Wed, 17 Apr 2013 07:03:19 -0700 (PDT)
Sender: joe.gregorio@gmail.com
Received: by 10.64.53.136 with HTTP; Wed, 17 Apr 2013 07:03:19 -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: Wed, 17 Apr 2013 10:03:19 -0400
X-Google-Sender-Auth: 3cpT4pqqw_jyyiqr6uHDi1YXsj4
Message-ID: <CA+-NybWfR47yScyTBi7BRpJgj5SnCxWY1rDV5KC8PuE+JEV90A@mail.gmail.com>
From: Joe Gregorio <joe@bitworking.org>
To: Erik Wilde <dret@berkeley.edu>
Content-Type: text/plain; charset="ISO-8859-1"
Cc: "apps-discuss@ietf.org" <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: Wed, 17 Apr 2013 14:03:21 -0000

Sorry for the delay in responding.

On Mon, Apr 8, 2013 at 1:41 AM, 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
> (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 says
> that

The answer is in the text you quote:

"for each defined variable in the variable-list, append '.' to the
result string and then perform variable expansion"

The set of variables in the variable list is the empty set, so no '.'
is appended.

I agree that if this is confusing an addendum is in order.

  -joe

>, 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



--
Joe Gregorio        http://bitworking.org