Re: [apps-discuss] Question about json-home

Erik Wilde <dret@berkeley.edu> Wed, 19 February 2014 09:29 UTC

Return-Path: <dret@berkeley.edu>
X-Original-To: apps-discuss@ietfa.amsl.com
Delivered-To: apps-discuss@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3DC4D1A02D9 for <apps-discuss@ietfa.amsl.com>; Wed, 19 Feb 2014 01:29:00 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.749
X-Spam-Level:
X-Spam-Status: No, score=-4.749 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RP_MATCHES_RCVD=-0.548, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Dob9ux9CxZ7p for <apps-discuss@ietfa.amsl.com>; Wed, 19 Feb 2014 01:28:54 -0800 (PST)
Received: from cm04fe.IST.Berkeley.EDU (cm04fe.IST.Berkeley.EDU [169.229.218.145]) by ietfa.amsl.com (Postfix) with ESMTP id 373111A0396 for <apps-discuss@ietf.org>; Wed, 19 Feb 2014 01:28:54 -0800 (PST)
Received: from 46-126-158-51.dynamic.hispeed.ch ([46.126.158.51] helo=dretpro.local) by cm04fe.ist.berkeley.edu with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (auth plain:dret@berkeley.edu) (envelope-from <dret@berkeley.edu>) id 1WG3ST-0002Ir-Ey; Wed, 19 Feb 2014 01:28:50 -0800
Message-ID: <5304794D.1030808@berkeley.edu>
Date: Wed, 19 Feb 2014 10:28:45 +0100
From: Erik Wilde <dret@berkeley.edu>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.2.0
MIME-Version: 1.0
To: darrel@tavis.ca, IETF Apps Discuss <apps-discuss@ietf.org>
References: <CAKioOquZdb+_guHjJbNJORJipQ9pcVybPhk+w0PG8JweOZQWww@mail.gmail.com>
In-Reply-To: <CAKioOquZdb+_guHjJbNJORJipQ9pcVybPhk+w0PG8JweOZQWww@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 7bit
Archived-At: http://mailarchive.ietf.org/arch/msg/apps-discuss/h6NWbsaxe9twl3kj9YZskw19JHU
Subject: Re: [apps-discuss] Question about json-home
X-BeenThere: apps-discuss@ietf.org
X-Mailman-Version: 2.1.15
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, 19 Feb 2014 09:29:00 -0000

hello darrel.

On 2014-02-17, 16:23 , Darrel Miller wrote:
> In section 3 of the json-home spec[1], it states,
>> Resource Objects MUST have exactly one of the "href" and "href-vars"
>> properties.
> My understanding of this is that a resource must either provide a URL
> in the href property or a URI Template in the href-template property.

yes, i do think that this is the current model. but please note that 
there is a later, but related draft on "Link Hints":

http://tools.ietf.org/html/draft-nottingham-link-hint

this one is strictly about URIs (i.e., not templates), and basically 
factors out the capability to represent information that might be 
helpful when following a link. since in some of the work we've been 
doing we need this capability to also cover URI templates, there's also 
a "Link Descriptions" draft, which supports URI templates:

http://tools.ietf.org/html/draft-wilde-link-desc

there's quite a bit of overlap between those two drafts, but the second 
one might be interesting in terms of combining URIs and URI templates.

> I recently ran into an issue where I had a deployed json-home document
> with a resource that had a href property and it was decided to add
> support for an optional query parameter to the URI. Unfortunately,
> there is no way to change the json-home document to support this
> optional query parameter without making a breaking change.

i think that's due to *two* reasons. one reason is that yes, you made a 
change and would like to make that change in the home document. but more 
importantly, you've moved from using URIs to using URI templates. it's 
kind of hard to imagine how you can make that latter change without 
breaking things, when you assume that before that change, everything was 
happily working without having to support URI templates.

> Is it really necessary to have both "href" and "href-template"?  Can
> the presence of href-vars not be used as an indicator of something
> being a template?

technically yes, but what you're doing then is to basically *only* 
support href-template (i.e., URI templates), and use the absence of 
variables to conclude that the template is one that does not contain any 
variables. which btw may not be what you should do, because there's no 
requirement that *all* variables in a template are described via href-vars.

at least in our cases, we might happily omit variables *in the 
description* where their semantics are static and captured by the link 
relation. we would then only serve variable descriptions for those 
variables where interesting things (such as value ranges) change at 
runtime, so that clients can see those changing runtime constraints.

> Is there some other way of supporting this evolution without having to
> introduce a new link relation type?

i don't think so, if you're really moving from a URI to a URI template. 
you could envision a design where you *only* use URI templates, and some 
of them happen to have no variables. then you could safely add a 
variable to such a template, but on the other hand, you would create a 
design where all clients must support URI templates, and not just URIs.

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 |