Re: [apps-discuss] WGLC on draft-ietf-appsawg-http-problem-00.txt

Erik Wilde <dret@berkeley.edu> Tue, 09 December 2014 00:43 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 8CF241A1A78 for <apps-discuss@ietfa.amsl.com>; Mon, 8 Dec 2014 16:43:53 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.211
X-Spam-Level:
X-Spam-Status: No, score=-4.211 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] 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 DkKQugmpaLzl for <apps-discuss@ietfa.amsl.com>; Mon, 8 Dec 2014 16:43:51 -0800 (PST)
Received: from cm04fe.IST.Berkeley.EDU (cm04fe.IST.Berkeley.EDU [169.229.218.145]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 86F1F1A1A43 for <apps-discuss@ietf.org>; Mon, 8 Dec 2014 16:43:51 -0800 (PST)
Received: from dhcp-128-32-211-236.lips.berkeley.edu ([128.32.211.236]) by cm04fe.ist.berkeley.edu with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.76) (auth plain:dret@berkeley.edu) (envelope-from <dret@berkeley.edu>) id 1Xy8u5-00070I-Da; Mon, 08 Dec 2014 16:43:50 -0800
Message-ID: <548645C4.6050904@berkeley.edu>
Date: Mon, 08 Dec 2014 16:43:48 -0800
From: Erik Wilde <dret@berkeley.edu>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: "Julian F. Reschke" <julian.reschke@gmx.de>
References: <8D25F56B-EEEC-4858-9905-999DA0C6D52F@isode.com> <54855632.6080801@gmx.de> <8BA03684-EAA5-4693-8551-2C1A08C947AB@mnot.net>
In-Reply-To: <8BA03684-EAA5-4693-8551-2C1A08C947AB@mnot.net>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 7bit
Archived-At: http://mailarchive.ietf.org/arch/msg/apps-discuss/KNTwU5BiRddeuTQq6BXYOj9kJjE
Cc: Mark Nottingham <mnot@mnot.net>, "apps-discuss@ietf.org" <apps-discuss@ietf.org>
Subject: Re: [apps-discuss] WGLC on draft-ietf-appsawg-http-problem-00.txt
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: Tue, 09 Dec 2014 00:43:53 -0000

hello julian.

thanks for the detailed feedback!

On 2014-12-08, 15:35 , Mark Nottingham wrote:
>> On 8 Dec 2014, at 6:41 pm, Julian Reschke <julian.reschke@gmx.de> wrote:
>> In the spec:
>>>     The data model for problem details is a JSON [RFC7159] object; when
>>>     formatted as a JSON document, it uses the "application/problem+json"
>>>     media type.  Appendix A defines how to express them in an equivalent
>>>     XML format, which uses the "application/problem+xml" media type.
>> Why is this an appendix?
> When all things are equal, I'd prefer people to use JSON for APIs, not XML. If we move it to be a peer of the JSON format, we'd need to have some text advising when to use each, and that could get sticky. Putting it in an appendix seemed like a reasonable compromise. If we don't put it in an appendix, I'd almost want to put it in a separate document...

to me, it seems like the error serialization should simply match the 
serialization of the rest of the API, so there wouldn't be a need to 
recommend anything beyond this.

as a side note, for home documents, we have the setup that mark is 
referring to: two separate documents for JSON and XML:

http://tools.ietf.org/html/draft-nottingham-json-home-03
http://tools.ietf.org/html/draft-wilde-home-xml-03

personally, i think it's easier to have one document explain the overall 
model, and then have two serializations of it in the same documents, but 
i am fine either way.

>>>     The OPTIONAL RELAX NG schema [ISO-19757-2] for the XML format is:
>> What does "OPTIONAL" mean here? The schema doesn't seem optional at all; lacking it, you wouldn't even know what XML namespace to use.
> That's Erik's work, but I tend to agree.

i have a hard time remembering why it says "OPTIONAL" here. i think the 
reason was that we did not want to recommend a specific schema language 
and were simply using RELAX NG as one possible choice. but i think 
you're right that the term "OPTIONAL" does not make a lot of sense.

>>>     default namespace ns = "urn:ietf:rfc:XXXX"
>> This needs to state that it will be updated based on the assigned RFC number.
> Ack.

done. ("Note to RFC Editor: Please replace "XXXX" with assigned RFC 
number before publication.")

>>>     Extension arrays and objects can be serialized into the XML format by
>>>     considering an element containing a child or children to represent an
>>>     object, except for elements that contain only child element(s) named
>>>     'i', which are considered arrays.  For example, an alternate version
>>>     of the example above would appear in XML as:
>> This is written like guidance, but it's normative, right?

good point. what about this wording instead:

Extension arrays and objects are serialized into the XML format by 
considering an element containing a child or children to represent an 
object, except for elements that contain only child element(s) named 
'i', which are considered arrays. For example, the XML version of the 
JSON example above would appear as:

>>>     <?xml version="1.0" encoding="UTF-8"?>
>>>     <problem xmlns="urn:ietf:rfc:XXXX">
>>>       <type>http://example.com/probs/out-of-credit</type>
>>>       <title>You do not have enough credit.</title>
>>>       <detail>Your current balance is 30, but that costs 50.</detail>
>>>       <instance>
>>>         http://example.net/account/12345/msgs/abc
>>>       </instance>
>> It would be good to point out that due to the type definitions in the schema, the whitespace inside <instance> is ignorable.
> I'll leave this to Erik...

actually, i think in this case it might be less confusing to simply not 
have this extraneous whitespace in the example, so my suggestion is to 
change example to simply say:

<instance>http://example.net/account/12345/msgs/abc</instance>

thanks again for the review! 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 |