[2] [DFN[[[JSON Pointer]]]] は、 [[JSON]] [[文書]]の一部または全部を識別する[[指示子言語]]です。

* 仕様書

[REFS[
- [1] '''[CITE@en[RFC 6901 - JavaScript Object Notation (JSON) Pointer]] ([TIME[2013-08-08 13:44:36 +09:00]] 版) <http://tools.ietf.org/html/rfc6901>'''
- [5] [CITE@en[Best Practices for Fragment Identifiers and Media Type Definitions]] ([TIME[2013-04-29 23:11:19 +09:00]] 版) <http://www.w3.org/2001/tag/doc/mimeTypesAndFragids#json-pointer>
]REFS]

* 応用

[3] [[JSON Pointer]] は [[JSON Patch]] で使われています。

** 素片識別子

[4] [[JSON Pointer]] は[[素片識別子]]としても使えると [[RFC 6901]] でも一章を設けて説明されています。
ただし [[JSON Pointer]] を使う [[MIME型]]はなく、 [[RFC 6901]] と同時に [[RFC]] 化された [[JSON Patch]]
ですら[[素片識別子]]は規定していません。

[6] >>5 は、 [[JSON Pointer]] の構文が [[Ember.js]] などの[[素片識別子]]の用法と衝突するため、
[[HTML]] と [[JSON]] で[[内容折衝]]できるようにしたいなら避けるべきだと述べています。

[7] [CODE(MIME)@en[[[application/vnd.mason+json]]]] は [[RFC 6901]] 
を参照しています。

[FIG(quote)[
[FIGCAPTION[
[8] [CITE@en[REST API Reference - PayPal Developer]]
([TIME[2015-07-02 12:54:14 +09:00]] 版)
<https://developer.paypal.com/docs/api/>
]FIGCAPTION]

> String containing a JSON-Pointer value that references a location within the target document (the target location) where the operation is performed.

]FIG]


[FIG(quote)[
[FIGCAPTION[
[9] [CITE[JSON API — Latest Specification (v1.0)]]
([TIME[2015-11-16 23:46:06 +09:00]] 版)
<http://jsonapi.org/format/>
]FIGCAPTION]

> pointer: a JSON Pointer '''['''RFC6901''']''' to the associated entity in the request document '''['''e.g. "/data" for a primary data object, or "/data/attributes/title" for a specific attribute''']'''.

]FIG]


[FIG(quote)[
[FIGCAPTION[
[10] [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]

> The ‘application/openstack-images-v2.1-json-patch’ media type defined in this appendix adopts a restricted form of JSON-Pointers. A restricted JSON pointer is a Unicode string containing a sequence of exactly one reference token, prefixed by a ‘/’ (%x2F) character.
> If a reference token contains ‘~’ (%x7E) or ‘/’ (%x2F) characters, they must be encoded as ‘~0’ and ‘~1’ respectively.

]FIG]


[11] [CITE@en[RFC6901 JSON Pointer Support · Issue #39 · javaee/jsonb-spec]]
([TIME[2018-04-24 00:58:24 +09:00]])
<https://github.com/javaee/jsonb-spec/issues/39>

[12] [CITE@en[draft-pbryan-zyp-json-ref-03 - JSON Reference]], [TIME[2020-03-15 22:35:51 +09:00]] <https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03>