JSON Merge Patch
draft-ietf-appsawg-json-merge-patch-05

The information below is for an old version of the document
Document Type Active Internet-Draft (appsawg WG)
Authors Paul Hoffman  , James Snell 
Last updated 2014-07-23 (latest revision 2014-07-21)
Replaces draft-snell-merge-patch
Stream IETF
Intended RFC status Proposed Standard
Formats pdf htmlized (tools) htmlized bibtex
Reviews
Stream WG state Submitted to IESG for Publication
Document shepherd Murray Kucherawy
Shepherd write-up Show (last changed 2014-07-23)
IESG IESG state AD Evaluation::AD Followup
Consensus Boilerplate Unknown
Telechat date
Responsible AD Barry Leiba
Send notices to appsawg-chairs@tools.ietf.org, draft-ietf-appsawg-json-merge-patch@tools.ietf.org, apps-discuss@ietf.org
Applications Area Working Group                               P. Hoffman
Internet-Draft                                            VPN Consortium
Intended status: Standards Track                                J. Snell
Expires: January 22, 2015
                                                           July 21, 2014

                            JSON Merge Patch
                 draft-ietf-appsawg-json-merge-patch-05

Abstract

   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.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at http://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on January 22, 2015.

Copyright Notice

   Copyright (c) 2014 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (http://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Hoffman & Snell         Expires January 22, 2015                [Page 1]
Internet-Draft           application/merge-patch               July 2014

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
   2.  Processing Merge Patch Documents  . . . . . . . . . . . . . .   3
   3.  Example . . . . . . . . . . . . . . . . . . . . . . . . . . .   4
   4.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   5
   5.  Security Considerations . . . . . . . . . . . . . . . . . . .   6
   6.  Acknowledgements  . . . . . . . . . . . . . . . . . . . . . .   6
   7.  References  . . . . . . . . . . . . . . . . . . . . . . . . .   6
     7.1.  Normative References  . . . . . . . . . . . . . . . . . .   6
     7.2.  Informative References  . . . . . . . . . . . . . . . . .   7
   Appendix A.  Example Test Cases . . . . . . . . . . . . . . . . .   7
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .   9

1.  Introduction

   This specification defines the JSON merge patch document format,
   processing rules, and associated MIME media type identifier.  The
   merge patch format is primarily intended for use with the HTTP PATCH
   method [RFC5789] as a means of describing a set of modifications to a
   target resource's content.

   A JSON merge patch document describes changes to be made to a target
   JSON document using a syntax that closely mimics the document being
   modified.  Recipients of a merge patch document determine the exact
   set of changes being requested by comparing the content of the
   provided patch against the current content of the target document.
   If the provided merge patch contains members that do not appear
   within the target, those members are added.  If the target does
   contain the member, the value is replaced.  Null values in the merge
   patch are given special meaning to indicate the removal of existing
   values in the target.

   For example, given the following original JSON document:

     {
       "a": "b",
       "c": {
         "d": "e",
         "f": "g"
       }
     }

Hoffman & Snell         Expires January 22, 2015                [Page 2]
Internet-Draft           application/merge-patch               July 2014

   Changing the value of "a" and removing "f" can be achieved by
   sending:

     PATCH /target HTTP/1.1
     Host: example.org
     Content-Type: application/merge-patch+json

     {
       "a":"z",
       "c": {
         "f": null
       }
     }

   When applied to the target resource, the value of the "a" member is
   replaced with "z" and "f" is removed, leaving the remaining content
   untouched.

   This design means that merge patch documents are suitable for
   describing modifications to JSON documents that primarily use objects
   for their structure and do not make use of explicit null values.  The
   merge patch format is not appropriate for all JSON syntaxes.
Show full document text