Re: [apps-discuss] RFC 7386 on JSON Merge Patch -- ruined by format error

"Manger, James" <James.H.Manger@team.telstra.com> Tue, 14 October 2014 00:43 UTC

Return-Path: <James.H.Manger@team.telstra.com>
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 E7A691A033B for <apps-discuss@ietfa.amsl.com>; Mon, 13 Oct 2014 17:43:27 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.202
X-Spam-Level:
X-Spam-Status: No, score=-0.202 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HELO_EQ_AU=0.377, HOST_EQ_AU=0.327, RCVD_IN_DNSWL_NONE=-0.0001, RELAY_IS_203=0.994] autolearn=no
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 w5_7TcCP3UaU for <apps-discuss@ietfa.amsl.com>; Mon, 13 Oct 2014 17:43:26 -0700 (PDT)
Received: from ipxano.tcif.telstra.com.au (ipxano.tcif.telstra.com.au [203.35.82.200]) by ietfa.amsl.com (Postfix) with ESMTP id CE6081A0040 for <apps-discuss@ietf.org>; Mon, 13 Oct 2014 17:43:24 -0700 (PDT)
X-IronPort-AV: E=Sophos;i="5.04,714,1406556000"; d="scan'208";a="232471420"
Received: from unknown (HELO ipcbni.tcif.telstra.com.au) ([10.97.216.204]) by ipoani.tcif.telstra.com.au with ESMTP; 14 Oct 2014 11:29:52 +1100
X-IronPort-AV: E=McAfee;i="5600,1067,7590"; a="253113360"
Received: from wsmsg3706.srv.dir.telstra.com ([172.49.40.80]) by ipcbni.tcif.telstra.com.au with ESMTP; 14 Oct 2014 11:43:21 +1100
Received: from WSMSG3153V.srv.dir.telstra.com ([172.49.40.159]) by wsmsg3706.srv.dir.telstra.com ([172.49.40.80]) with mapi; Tue, 14 Oct 2014 11:43:19 +1100
From: "Manger, James" <James.H.Manger@team.telstra.com>
To: "rfc-editor@rfc-editor.org" <rfc-editor@rfc-editor.org>, "paul.hoffman@vpnc.org" <paul.hoffman@vpnc.org>, "jasnell@gmail.com" <jasnell@gmail.com>, "apps-discuss@ietf.org" <apps-discuss@ietf.org>
Date: Tue, 14 Oct 2014 11:43:19 +1100
Thread-Topic: [apps-discuss] RFC 7386 on JSON Merge Patch -- ruined by format error
Thread-Index: Ac/nPEH7B2IIaSusSLyWdVDhuhdXAgACSlGQ
Message-ID: <255B9BB34FB7D647A506DC292726F6E127CF021CE0@WSMSG3153V.srv.dir.telstra.com>
References: <20141013231812.8ABB8181C82@rfc-editor.org>
In-Reply-To: <20141013231812.8ABB8181C82@rfc-editor.org>
Accept-Language: en-US, en-AU
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US, en-AU
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Archived-At: http://mailarchive.ietf.org/arch/msg/apps-discuss/1irdGcV5EbdTCxtSMDvMnNmIx8s
Subject: Re: [apps-discuss] RFC 7386 on JSON Merge Patch -- ruined by format error
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, 14 Oct 2014 00:43:28 -0000

It is great to see JSON Merge Patch become an RFC!

But the indenting for the function in section 2 (which is the core of the whole doc) was been screwed up. It is no longer comprehensible! https://tools.ietf.org/html/rfc7386#section-2

It was correct in draft-ietf-appsawg-json-merge-patch-07. Indenting indicated the scope of "if", "for", "else" clauses.

   define MergePatch(Target, Patch):
     if Patch is an Object:
       if Target is not an Object:
         Target = {} # Ignore the contents and set it to an empty Object
       for each Name/Value pair in Patch:
         if Value is null:
           if Name exists in Target:
             remove the Name/Value pair from Target
         else:
           Target[Name] = MergePatch(Target[Name], Value)
       return Target
     else:
       return Patch

It is wrong in RFC 7386. You cannot tell what is in the "for" loop, for instance.

     define MergePatch(Target, Patch):
       if Patch is an Object:
         if Target is not an Object:
       Target = {} # Ignore the contents and set it to an empty Object
         for each Name/Value pair in Patch:
       if Value is null:
         if Name exists in Target:
           remove the Name/Value pair from Target
       else:
         Target[Name] = MergePatch(Target[Name], Value)
         return Target
       else:
         return Patch

--
James Manger


-----Original Message-----
From: apps-discuss [mailto:apps-discuss-bounces@ietf.org] On Behalf Of rfc-editor@rfc-editor.org
Sent: Tuesday, 14 October 2014 10:18 AM
To: ietf-announce@ietf.org; rfc-dist@rfc-editor.org
Cc: drafts-update-ref@iana.org; apps-discuss@ietf.org; rfc-editor@rfc-editor.org
Subject: [apps-discuss] RFC 7386 on JSON Merge Patch

A new Request for Comments is now available in online RFC libraries.

        
        RFC 7386

        Title:      JSON Merge Patch 
        Author:     P. Hoffman, J. Snell
        Status:     Standards Track
        Stream:     IETF
        Date:       October 2014
        Mailbox:    paul.hoffman@vpnc.org, 
                    jasnell@gmail.com
        Pages:      9
        Characters: 12930
        Updates/Obsoletes/SeeAlso:   None

        I-D Tag:    draft-ietf-appsawg-json-merge-patch-07.txt

        URL:        https://www.rfc-editor.org/rfc/rfc7386.txt

This specification defines the JSON merge patch format and processing
rules.  The merge patch format is primarily intended for use with the
HTTP PATCH method as a means of describing a set of modifications to
a target resource's content.

This document is a product of the Applications Area Working Group Working Group of the IETF.

This is now a Proposed Standard.

STANDARDS TRACK: This document specifies an Internet Standards Track
protocol for the Internet community, and requests discussion and suggestions
for improvements.  Please refer to the current edition of the Official
Internet Protocol Standards (https://www.rfc-editor.org/standards) for the 
standardization state and status of this protocol.  Distribution of this 
memo is unlimited.

This announcement is sent to the IETF-Announce and rfc-dist lists.
To subscribe or unsubscribe, see
  https://www.ietf.org/mailman/listinfo/ietf-announce
  https://mailman.rfc-editor.org/mailman/listinfo/rfc-dist

For searching the RFC series, see https://www.rfc-editor.org/search
For downloading RFCs, see https://www.rfc-editor.org/rfc.html

Requests for special distribution should be addressed to either the
author of the RFC in question, or to rfc-editor@rfc-editor.org.  Unless
specifically noted otherwise on the RFC itself, all RFCs are for
unlimited distribution.


The RFC Editor Team
Association Management Solutions, LLC


_______________________________________________
apps-discuss mailing list
apps-discuss@ietf.org
https://www.ietf.org/mailman/listinfo/apps-discuss