[2] [DFN[[[JSON Patch]]]] は、 [[JSON]] [[文書]]の[[差分]]を [[JSON]] として記述する[[文書形式]]です。

* 仕様書

[REFS[
- [1] [CITE@en[RFC 6902 - JavaScript Object Notation (JSON) Patch]] ([TIME[2013-08-08 12:35:00 +09:00]] 版) <http://tools.ietf.org/html/rfc6902>
]REFS]

* MIME 型

[4] [[MIME型]]としては [DFN[[CODE(MIME)@en[[[application/json-patch+json]]]]]]
が規定されています。[[引数]]はありません。 [SRC[>>1]]

* 応用

[3] [[RFC]] では主に [[HTTP]] [CODE(HTTP)@en[[[PATCH]]]] [[メソッド]]で利用することが想定されている [SRC[>>1]]
ようです。

* 関連

[5] [[JSON Patch]] では[[差分]]の適用位置を指定するために [[JSON Pointer]] が使われています。

[6] [CITE[The diffing side of JSON Patch - Google グループ]]
( ([TIME[2013-12-12 02:28:01 +09:00]] 版))
<https://groups.google.com/forum/#!topic/json-patch/UcKvMjukhmk>

[7] [[JSON Merge Patch]] というものもあります。両者に互換性はありません。

[FIG(quote)[
[FIGCAPTION[
[8] [CITE[Image API v2 HTTP PATCH media types — Glance Specs 0.0.1.dev157 documentation]]
([TIME[2016-03-11 02:50:48 +09:00]] 版)
<https://specs.openstack.org/openstack/glance-specs/specs/api/v2/http-patch-image-api-v2.html>
]FIGCAPTION]

> For image resources, two media types are supported:
> application/openstack-images-v2.1-json-patch
> application/openstack-images-v2.0-json-patch
> The application/openstack-images-v2.1-json-patch media type is intended to provide a useful and compatible subset of the functionality defined in JavaScript Object Notation (JSON) Patch RFC6902, which defines the application/json-patch+json media type.
> The application/openstack-images-v2.0-json-patch media type is based on draft 4 of the standard. Its use is deprecated.

]FIG]


[FIG(quote)[
[FIGCAPTION[
[9] [CITE[JSON API — JSON Patch Extension]]
([TIME[2016-03-20 23:22:07 +09:00]] 版)
<http://jsonapi.org/extensions/jsonpatch/>
]FIGCAPTION]

> The "JSON Patch extension" is an official extension of the JSON API specification. It provides support for modification of resources with the HTTP PATCH method '''['''RFC5789''']''' and the JSON Patch format '''['''RFC6902''']'''.

]FIG]


[FIG(quote)[
[FIGCAPTION[
[10] [CITE@en[Buckets — Kinto 8.1.5 documentation]]
([TIME[2018-02-21 01:03:17 +09:00]])
<https://kinto.readthedocs.io/en/latest/api/1.x/buckets.html>
]FIGCAPTION]

> It’s possible to use JSON-Patch by sending the request header Content-Type: application/json-patch+json.

]FIG]
