Subject: [apps-discuss] RFC 7386 on JSON Merge Patch

From: [email-masked]
Date: Mon, 13 Oct 2014 16:18:12 -0700 (PDT)

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:    [email-masked], 
                    [email-masked]
        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 [email-masked].  Unless
specifically noted otherwise on the RFC itself, all RFCs are for
unlimited distribution.

The RFC Editor Team
Association Management Solutions, LLC

---

From: "Manger, James" <[email-masked]>
Date: Tue, 14 Oct 2014 11:43:19 +1100

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:[email-masked]] On Behalf Of [email-masked]
Sent: Tuesday, 14 October 2014 10:18 AM
To: [email-masked]; [email-masked]
Cc: [email-masked]; [email-masked]; [email-masked]
Subject: [apps-discuss] RFC 7386 on JSON Merge Patch

        RFC 7386

        Title:      JSON Merge Patch 

The RFC Editor Team

_______________________________________________
apps-discuss mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/apps-discuss

---

From: Martin Thomson <[email-masked]>
Date: Mon, 13 Oct 2014 23:11:11 -0700

On 13 October 2014 17:43, Manger, James <[email-masked]> wrote:
> the indenting for the function in section 2 (which is the core of the whole doc) was been screwed up

best argument against use of python I've seen