Re: [weirds] feedback on draft-designteam-weirds-using-http

Andy Newton <andy@hxr.us> Thu, 31 May 2012 00:48 UTC

Return-Path: <andy@hxr.us>
X-Original-To: weirds@ietfa.amsl.com
Delivered-To: weirds@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 172EB11E812C for <weirds@ietfa.amsl.com>; Wed, 30 May 2012 17:48:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.599
X-Spam-Level:
X-Spam-Status: No, score=-3.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1]
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 pDUytBunmI8U for <weirds@ietfa.amsl.com>; Wed, 30 May 2012 17:48:07 -0700 (PDT)
Received: from mail-ob0-f172.google.com (mail-ob0-f172.google.com [209.85.214.172]) by ietfa.amsl.com (Postfix) with ESMTP id DE73C11E8126 for <weirds@ietf.org>; Wed, 30 May 2012 17:48:06 -0700 (PDT)
Received: by obbeh20 with SMTP id eh20so572787obb.31 for <weirds@ietf.org>; Wed, 30 May 2012 17:48:06 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=6GS3t14M8t3mwvaCriIAFRfHMZR9IBvJuskHk44Vq2A=; b=nlvLjGUOizPP8BS0siYoGPGrhLRhIN3u2PLmpS1fiWcNi/X6yLXWwuFJ0wOgM4ujVl GJcYosiWGK2UiR8PExhFUml/75my3iDfgLS157B0Jw9Tb03a24IWGvKzr6hpYZQi2GjR YuM87sXwQPAWy5Z3htO4y1EdrRGk0NFZJoWw00WlYnSs66Np008l3RJwHu4SWBfSYNBM /qLWCBI3+fyupb2JS25sTHumTpMt/55LYFJDfVOFD9c8knsu+jJPBjxXrr7eU+NPP/IL /sUDK/g/wMkUc7pn0I98uNM9u2w//PNnEHG6OtcYWGjN6KOcyE/C8t9OlypRm9whmHUy T+8Q==
Received: by 10.182.11.69 with SMTP id o5mr179517obb.33.1338425286138; Wed, 30 May 2012 17:48:06 -0700 (PDT)
Received: from [10.0.1.6] (ip68-98-152-27.dc.dc.cox.net. [68.98.152.27]) by mx.google.com with ESMTPS id zn5sm1173738obb.18.2012.05.30.17.48.03 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 30 May 2012 17:48:04 -0700 (PDT)
Mime-Version: 1.0 (Apple Message framework v1257)
Content-Type: text/plain; charset="us-ascii"
From: Andy Newton <andy@hxr.us>
In-Reply-To: <FEE5C6EC77CD3B4C9171FE9E0D31394D098A235A@kambx2.SIDN.local>
Date: Wed, 30 May 2012 20:48:02 -0400
Content-Transfer-Encoding: quoted-printable
Message-Id: <ABEA56BD-90D3-42C3-8325-7954FF2EA79D@hxr.us>
References: <4FB26082.3070800@gmx.de> <9B94D739-E037-4539-82E8-0E79BBFEC543@hxr.us> <4FB520B4.1070803@gmx.de> <A58EF70A-BBAA-4DA5-A951-C1F16356F741@hxr.us> <FEE5C6EC77CD3B4C9171FE9E0D31394D098A235A@kambx2.SIDN.local>
To: Maarten Wullink <maarten.wullink@sidn.nl>
X-Mailer: Apple Mail (2.1257)
X-Gm-Message-State: ALoCoQn+gzfDrAYy5PqOh+Tr0dEtTnwAYoGbJgZsQ0zjECK3f1ummK8MP+UzG4PjymvfUMy/CwiS
Cc: "weirds@ietf.org" <weirds@ietf.org>
Subject: Re: [weirds] feedback on draft-designteam-weirds-using-http
X-BeenThere: weirds@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "WHOIS-based Extensible Internet Registration Data Service \(WEIRDS\)" <weirds.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/weirds>, <mailto:weirds-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/weirds>
List-Post: <mailto:weirds@ietf.org>
List-Help: <mailto:weirds-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/weirds>, <mailto:weirds-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 31 May 2012 00:48:08 -0000

Maarten,

Using media types for versioning RESTful interfaces has been quite common in the industry for years. I would hardly call it abusive. Here is an old post by Peter Williams on the subject: 
http://barelyenough.org/blog/2008/05/versioning-rest-web-services/

Looking around though, it would seem that use the level extension is a way of using the Accept/Content-Type headers without encoding the version in the media type itself. See: 
http://techbits.blogspot.com/2012/02/versioning-restful-apis-there-seems-to.html

Though level is not explicitly specified in the Content-Type header definition, the syntax is legal as a parameter the same as it is specified in the Accept header. This seems like a decent approach.

-andy


On May 30, 2012, at 3:13 AM, Maarten Wullink wrote:

> I would suggest removing the versioning information from the content-type.
> Put the version information in the URL itself, like this where "v1" is the version 1 of the API.
> 
> /base/v1/domains/example.com
> 
> This way is clear what version of the API the client is connecting to and you do
> Not have to abuse the content-type for this.
> 
> For more about versioning see:
> http://blog.apigee.com/taglist/versioning
> 
> 
> application\weirds_blah_v1+json
> 
> -----Original Message-----
> From: weirds-bounces@ietf.org [mailto:weirds-bounces@ietf.org] On Behalf Of Andy Newton
> Sent: donderdag 17 mei 2012 20:54
> To: Julian Reschke
> Cc: weirds@ietf.org
> Subject: Re: [weirds] feedback on draft-designteam-weirds-using-http
> 
> 
> On May 17, 2012, at 12:00 PM, Julian Reschke wrote:
> 
>> Using URI templates sound promising.
> 
> This keeps coming up, but so far nobody has shown why it is useful. I think what we want out of URI templating is to be shown what utility it adds before placing it in the specifications.
> 
>>>> b) s/MIME type/media type/
>>>> 
>>>>  Accept header.  Servers SHOULD respond with an appropriate MIME type
>>>>  in the Accept header in accordance with the preference rules for the
>>>>  Accept header in HTTP [RFC2616].  However the use by clients of
>>>>  multiple MIME types in the Accept header is NOT RECOMMENDED.
>>>> 
>>>> It's not clear to me why you're profiling HTTP here.
>>> 
>>> Because for this application, clients will probably only know one format. The need to use the complex rules for specifying multiple formats is unnecessary.
>> 
>> I don't follow. Servers need to process the Accept header field according to RFC 2616. Are you saying they can rely on it being simpler? In which case, this would need to be a "MUST NOT".
> 
> Uh, yeah. I think I'm trying to have it both ways. It's probably best to simply remove this.
> 
>>>>  that it desires JSON or "application\weirds_blah_v1+json" to express
>>>>  that it desires WEIRDS BLAH version 1 in JSON.  The server MUST
>>>>  respond with "application\weirds_blah_v1+json".
>>>> 
>>>> This seems to invent a new concept of media ranges in content negotiation that didn't exist before. Why is this needed?
>>> 
>>> For signaling the version of the schema desired. Is there another method you feel is more appropriate?
>> 
>> The method is probably ok, but the way it was explained was confusing: client specifies it wants "A", but server is allowed to return "B" (and label it as "B"), if it has out-of-band info that the client will understand it, too. Note that here "A" and "B" could be any media type (the label is really opaque).
> 
> Ok. I'll look into cleaning this up.
> 
>> 
>>>> 5.2.  Redirects
>>>> 
>>>>  If a server wishes to inform a client that the answer to a given
>>>>  query can be found elsewhere, it should return either a 301 or a 303
>>>>  reponse code and an HTTP URL in the Redirect header.  The client is
>>>> 
>>>> s/reponse/response/
>>>> 
>>>>  expected to issue a subsequent query using the given URL without any
>>>>  processing of the URL.  In other words, the server is to hand back a
>>>>  complete URL and the client should not have to transform the URL to
>>>>  follow it.
>>>> 
>>>> HTTPbis allows relative URIs here, and so should this protocol.
>>> 
>>> Why? It is simpler for the clients if the URLs are absolute.
>> 
>> Do not profile the base protocol unless there is a very very good reason.
> 
> I now understand what you are saying.
> 
>>>>  ...
>>>> 
>>>> 7.  Use of XML
>>>> 
>>>> 7.1.  Signaling
>>>> 
>>>>  Clients may signal their desire for XML using the "application\xml"
>>>>  mime type or a more application specific XML mime type.
>>>> 
>>>> 7.2.  Naming and Structure
>>>> 
>>>>  Well-formed XML may be programmatically produced using the JSON
>>>>  encodings due to the JSON naming rules outlined in Section 6.2 and
>>>>  the following simple rules:
>>>> 
>>>>  1.  Where a JSON name is given, the corresponding XML element has the
>>>>      same name.
>>>> 
>>>>  2.  Where a JSON value is found, it is the content of the
>>>>      corresponding XML element.
>>>> 
>>>> That is not true for all JSON values (consider control characters).
>>> 
>>> Ah yes, the escaping needs to be changed from JSON to XML.
>> 
>> There's still a set of characters that won't be usable in XML (yes, not even escaped).
> 
> That would be &, <, and >. So I guess we should mention those are to be escaped as well. Gosh XML is overly complex.
> 
> 
> Thanks for the input.
> 
> -andy
> 
> _______________________________________________
> weirds mailing list
> weirds@ietf.org
> https://www.ietf.org/mailman/listinfo/weirds
> _______________________________________________
> weirds mailing list
> weirds@ietf.org
> https://www.ietf.org/mailman/listinfo/weirds