Re: [apps-discuss] json-home: comments and questions on draft 02

Dirk Fröhner <dirk.f5r@googlemail.com> Thu, 15 November 2012 16:30 UTC

Return-Path: <dirk.f5r@googlemail.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 83A6A21F8A0D for <apps-discuss@ietfa.amsl.com>; Thu, 15 Nov 2012 08:30:04 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.449
X-Spam-Level:
X-Spam-Status: No, score=-3.449 tagged_above=-999 required=5 tests=[AWL=-0.150, BAYES_00=-2.599, MIME_8BIT_HEADER=0.3, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SiW47BgAZZ5P for <apps-discuss@ietfa.amsl.com>; Thu, 15 Nov 2012 08:30:03 -0800 (PST)
Received: from mail-bk0-f44.google.com (mail-bk0-f44.google.com [209.85.214.44]) by ietfa.amsl.com (Postfix) with ESMTP id 4492821F88D4 for <apps-discuss@ietf.org>; Thu, 15 Nov 2012 08:30:02 -0800 (PST)
Received: by mail-bk0-f44.google.com with SMTP id w11so886264bku.31 for <apps-discuss@ietf.org>; Thu, 15 Nov 2012 08:30:01 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=27vb7NQp1mzXqUSZ3cmS94CWVI+F0nFMypx6v7BemIk=; b=ToPrdfKCcWbGY60YE640N2ux9pTIKibjMy7uGkx3V035+9YfWBJ0xgIBOP4DxrXcCe KlVo0YIbwm2gfTtmz+WicJAnYDoV8HGfgDnGk2q0vMXmGKlpBUHGGZUtSL1B2C7uEx6B Pa4aGLpQjKaGU1jh0rnVIrcCpZsNjiwF7qEBf/GGyYA8frGwqcb1EIqgBiEHrt+cm1V9 3mbOmvSu03SuX9Y1734aQQR9m8cr9fmrE+gsZ6ZgbucxrRtZk3dKVT4ynvetbpEls1Ni 7tDj9fg3KRkyKVd4MwkA0l/o+OCljP0DZXZ5kqAFGDK1/Tmy5CxGPbLutGmonyNTl6+v +5gQ==
Received: by 10.204.130.10 with SMTP id q10mr673797bks.59.1352997001206; Thu, 15 Nov 2012 08:30:01 -0800 (PST)
Received: from limo3121.local ([62.213.144.96]) by mx.google.com with ESMTPS id g8sm10807422bkv.6.2012.11.15.08.29.59 (version=SSLv3 cipher=OTHER); Thu, 15 Nov 2012 08:30:00 -0800 (PST)
Message-ID: <50A51886.8010903@googlemail.com>
Date: Thu, 15 Nov 2012 17:29:58 +0100
From: Dirk Fröhner <dirk.f5r@googlemail.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: apps-discuss@ietf.org
References: <50A38259.4050304@googlemail.com> <3B530232-381D-4370-980B-B5B308443DDF@mnot.net>
In-Reply-To: <3B530232-381D-4370-980B-B5B308443DDF@mnot.net>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 8bit
Subject: Re: [apps-discuss] json-home: comments and questions on draft 02
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: Thu, 15 Nov 2012 16:30:05 -0000

Mark,

thanks for your response. More comments inline.

Glück auf!
Dirk

On 15/11/12 1:37 AM, Mark Nottingham wrote:
> On 14/11/2012, at 10:36 PM, Dirk F5R <dirk.f5r@googlemail.com> wrote:
>
>> Hi all, hi Mark,
>>
>> I had a closer look at http://pretty-rfc.herokuapp.com/draft-nottingham-json-home and http://tools.ietf.org/html/draft-nottingham-json-home-02 since I also absolutely see the need for an API "home page" as well. As a matter of fact, the specs I have contributed to at work come with what we call a "service document" (I can't help using that term in the remainder of this mail). This is only another term for basically the same concept: one single entry point into a hypermedia API that reveals links to something like top-level resources. The URI to the service document is the only thing that needs to be published to client developers, from there we strictly follow the HATEOAS principle.
>>
>> I have a few comments / questions on json-home:
>>
>> When I look at the json-home draft, it looks to me as if it were actually two separate ones. One that deals with the need of a service document and how it might look like and one that defines how links should look like in JSON. The latter one though is nothing specific to the service document but would rather be a general convention. Shouldn't this be two separate draft documents?
> Possibly. The thing is, I'm not yet convinced that there's a single style of linking that's right for all uses -- or even a majority of cases -- in JSON, so I haven't tackled this yet. Having a home document seemed to be the low-hanging fruit, and I expect that if we do one day have a predominant way of linking in JSON, we'll converge on that somehow.
Different styles of linking (in JSON) is actually something about which 
we had many discussions in our office during the last months...
> I have talked to Mike about HAL; it may be a contender for enough use cases to be interesting, but I didn't want to tie the fate of this spec to HAL.
...and I would actually be very interested to exchange our results with 
you and Mike - not sure if this should take place exactly here though?
> In the meantime, the links in json-home are interoperable with other serialisations of links (including HAL). The important thing is that the underlying semantics of the link are well-defined, as per RFC5988. The syntax doesn't matter as much (caveat: see below).
>
>
>> As to my current perception, I'm also not sure why the service document should have a different format or structure than any other document that comes back from an API. For instance, if your representations always come with an attribute called "links" that hosts explicit links by relation types, why should this be different for the service document? This leads me to the opinion that it should be defined <somewhere> as a requirement that hypermedia APIs must come with a service document but I don't necessarily see the need to define a particular format or media type for it.
>
> Well, we get concrete benefits when off-the-shelf software can consume a known format; having to relearn every format as you encounter it is expensive (in money, time and effort) and error-prone.
That would mean that off-the-shelf software could consume the API home 
docs but it doesn't necessarily mean that it can consume any other 
representation that comes back when one of the links in the home doc is 
followed. We had something similar in place previously where we were 
kind of forced to employ a resource discovery format (JRD, i.e. XRD for 
JSON) as API home doc and found it very inconvenient to have a different 
format for this. By now we use the same format for API home docs as for 
any other representation that comes back from our APIs. In particular 
this means that we have a consistent way of representing links. But 
maybe I don't completely understand what you have in mind with the 
ability to "scan" API home docs and do stuff with it.
>
> My observation is that coming up with a framework that abstracts out the world into a single format convention is Hard (see: RDF), so I decided to try something more modest here. People intuitively understand "home document."
I'm absolutely with you, I guess it's more a question if that home 
document has to be in a special format. If you compare it with the home 
page of a website, you also wouldn't expect that in a different format 
than any other page that comes from the site.
>
> Cheers,
>
> --
> Mark Nottingham   http://www.mnot.net/
>
>
>