[要約] RFC 7158はJSONデータの交換形式に関する規格であり、JSONの構文とセマンティクスを定義しています。目的は、異なるプログラミング言語やプラットフォーム間でデータを効率的に交換するための標準化です。

Internet Engineering Task Force (IETF)                      T. Bray, Ed.
Request for Comments: 7158                                  Google, Inc.
Obsoletes: 4627                                               March 2013
Category: Standards Track
ISSN: 2070-1721
        

The JavaScript Object Notation (JSON) Data Interchange Format

JavaScript Object Notation(JSON)データ交換フォーマット

Abstract

概要

JavaScript Object Notation (JSON) is a lightweight, text-based, language-independent data interchange format. It was derived from the ECMAScript Programming Language Standard. JSON defines a small set of formatting rules for the portable representation of structured data.

JavaScript Object Notation(JSON)は、軽量でテキストベースの、言語に依存しないデータ交換フォーマットです。 ECMAScriptプログラミング言語標準から派生しました。 JSONは、構造化されたデータの移植可能な表現のための小さなフォーマットルールのセットを定義します。

This document removes inconsistencies with other specifications of JSON, repairs specification errors, and offers experience-based interoperability guidance.

このドキュメントは、JSONの他の仕様との不整合を取り除き、仕様エラーを修正し、経験ベースの相互運用性ガイダンスを提供します。

Status of This Memo

本文書の状態

This is an Internet Standards Track document.

これはInternet Standards Trackドキュメントです。

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 5741.

このドキュメントは、IETF(Internet Engineering Task Force)の製品です。これは、IETFコミュニティのコンセンサスを表しています。公開レビューを受け、インターネットエンジニアリングステアリンググループ(IESG)による公開が承認されました。インターネット標準の詳細については、RFC 5741のセクション2をご覧ください。

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc7158.

このドキュメントの現在のステータス、エラータ、およびフィードバックの提供方法に関する情報は、http://www.rfc-editor.org/info/rfc7158で入手できます。

Copyright Notice

著作権表示

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

Copyright(c)2013 IETF Trustおよびドキュメントの作成者として識別された人物。全著作権所有。

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.

この文書は、BCP 78およびこの文書の発行日に有効なIETF文書に関するIETFトラストの法的規定(http://trustee.ietf.org/license-info)の対象となります。これらのドキュメントは、このドキュメントに関するあなたの権利と制限を説明しているため、注意深く確認してください。このドキュメントから抽出されたコードコンポーネントには、Trust Legal Provisionsのセクション4.eに記載されているSimplified BSD Licenseのテキストが含まれている必要があり、Simplified BSD Licenseに記載されているように保証なしで提供されます。

This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The person(s) controlling the copyright in some of this material may not have granted the IETF Trust the right to allow modifications of such material outside the IETF Standards Process. Without obtaining an adequate license from the person(s) controlling the copyright in such materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process, except to format it for publication as an RFC or to translate it into languages other than English.

このドキュメントには、2008年11月10日より前に公開または公開されたIETFドキュメントまたはIETFコントリビューションの素材が含まれている場合があります。この素材の一部で著作権を管理している人が、IETFトラストにそのような素材の変更を許可する権利を付与していない可能性がありますIETF標準プロセス外。このような資料の著作権を管理する人から適切なライセンスを取得せずに、このドキュメントをIETF標準プロセス外で変更したり、その派生物をIETF標準プロセス外で作成したりすることはできません。 RFCとして、またはそれを英語以外の言語に翻訳するための出版物。

Table of Contents

目次

   1. Introduction ....................................................3
      1.1. Conventions Used in This Document ..........................4
      1.2. Specifications of JSON .....................................4
      1.3. Introduction to This Revision ..............................4
   2. JSON Grammar ....................................................4
   3. Values ..........................................................5
   4. Objects .........................................................6
   5. Arrays ..........................................................6
   6. Numbers .........................................................6
   7. Strings .........................................................8
   8. String and Character Issues .....................................9
      8.1. Character Encoding .........................................9
      8.2. Unicode Characters .........................................9
      8.3. String Comparison ..........................................9
   9. Parsers ........................................................10
   10. Generators ....................................................10
   11. IANA Considerations ...........................................10
   12. Security Considerations .......................................11
   13. Examples ......................................................12
   14. Contributors ..................................................13
   15. References ....................................................13
      15.1. Normative References .....................................13
      15.2. Informative References ...................................13
   Appendix A. Changes from RFC 4627 .................................15
        
1. Introduction
1. はじめに

JavaScript Object Notation (JSON) is a text format for the serialization of structured data. It is derived from the object literals of JavaScript, as defined in the ECMAScript Programming Language Standard, Third Edition [ECMA-262].

JavaScript Object Notation(JSON)は、構造化データのシリアル化のためのテキスト形式です。 ECMAScriptプログラミング言語標準、第3版[ECMA-262]で定義されているように、JavaScriptのオブジェクトリテラルから派生しています。

JSON can represent four primitive types (strings, numbers, booleans, and null) and two structured types (objects and arrays).

JSONは4つのプリミティブ型(文字列、数値、ブール値、およびnull)と2つの構造型(オブジェクトと配列)を表すことができます。

A string is a sequence of zero or more Unicode characters [UNICODE]. Note that this citation references the latest version of Unicode rather than a specific release. It is not expected that future changes in the UNICODE specification will impact the syntax of JSON.

文字列は、0個以上のUnicode文字[UNICODE]のシーケンスです。この引用は、特定のリリースではなく、最新バージョンのUnicodeを参照していることに注意してください。 UNICODE仕様の将来の変更がJSONの構文に影響を与えることは想定されていません。

An object is an unordered collection of zero or more name/value pairs, where a name is a string and a value is a string, number, boolean, null, object, or array.

オブジェクトは、0個以上の名前と値のペアの順序付けられていないコレクションです。名前は文字列で、値は文字列、数値、ブール値、null、オブジェクト、または配列です。

An array is an ordered sequence of zero or more values.

配列は、0個以上の値の順序付けられたシーケンスです。

The terms "object" and "array" come from the conventions of JavaScript.

「オブジェクト」および「配列」という用語は、JavaScriptの規則に由来しています。

JSON's design goals were for it to be minimal, portable, textual, and a subset of JavaScript.

JSONの設計目標は、JSONが最小限で、移植可能で、テキストであり、JavaScriptのサブセットであることです。

1.1. Conventions Used in This Document
1.1. このドキュメントで使用される規則

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].

このドキュメントのキーワード「MUST」、「MUST NOT」、「REQUIRED」、「SHALL」、「SHALL NOT」、「SHOULD」、「SHOULD NOT」、「RECOMMENDED」、「MAY」、および「OPTIONAL」は、 [RFC2119]で説明されているように解釈されます。

The grammatical rules in this document are to be interpreted as described in [RFC5234].

このドキュメントの文法規則は、[RFC5234]で説明されているように解釈されます。

1.2. Specifications of JSON
1.2. JSONの仕様

This document updates [RFC4627], which describes JSON and registers the media type "application/json".

このドキュメントは、JSONを記述し、メディアタイプ「application / json」を登録する[RFC4627]を更新します。

A description of JSON in ECMAScript terms appears in Version 5.1 of the ECMAScript specification [ECMA-262], Section 15.12. JSON is also described in [ECMA-404].

ECMAScript用語でのJSONの説明は、ECMAScript仕様のバージョン5.1 [ECMA-262]、セクション15.12に記載されています。 JSONも[ECMA-404]で記述されています。

All of the specifications of JSON syntax agree on the syntactic elements of the language.

JSON構文の仕様はすべて、言語の構文要素に同意します。

1.3. Introduction to This Revision
1.3. このリビジョンの紹介

In the years since the publication of RFC 4627, JSON has found very wide use. This experience has revealed certain patterns, which, while allowed by its specifications, have caused interoperability problems.

RFC 4627の公開以来、JSONは非常に広く使用されてきました。この経験から特定のパターンが明らかになりましたが、その仕様では許可されていますが、相互運用性の問題を引き起こしています。

Also, a small number of errata have been reported (see RFC Errata IDs 607 [Err607] and 3607 [Err3607]).

また、少数のエラッタが報告されています(RFC Errata ID 607 [Err607]および3607 [Err3607]を参照)。

This document's goal is to apply the errata, remove inconsistencies with other specifications of JSON, and highlight practices that can lead to interoperability problems.

このドキュメントの目的は、正誤表を適用し、JSONの他の仕様との不整合を取り除き、相互運用性の問題につながる可能性があるプラクティスを強調することです。

2. JSON Grammar
2. JSON文法

A JSON text is a sequence of tokens. The set of tokens includes six structural characters, strings, numbers, and three literal names.

JSONテキストはトークンのシーケンスです。トークンのセットには、6つの構造文字、文字列、数字、および3つのリテラル名が含まれています。

A JSON text is a serialized value. Note that certain previous specifications of JSON constrained a JSON text to be an object or an array. Implementations that generate only objects or arrays where a JSON text is called for will be interoperable in the sense that all implementations will accept these as conforming JSON texts.

JSONテキストはシリアル化された値です。 JSONの特定の以前の仕様では、JSONテキストがオブジェクトまたは配列になるように制約されていたことに注意してください。 JSONテキストが要求されるオブジェクトまたは配列のみを生成する実装は、すべての実装がこれらを適合JSONテキストとして受け入れるという意味で相互運用可能です。

JSON-text = ws value ws

JSON-text = ws value ws

These are the six structural characters:

これらは6つの構造的特性です。

begin-array = ws %x5B ws ; [ left square bracket

begin-array = ws%x5B ws; [左角かっこ

      begin-object    = ws %x7B ws  ; { left curly bracket
        

end-array = ws %x5D ws ; ] right square bracket

end-array = ws%x5D ws; ]右角かっこ

      end-object      = ws %x7D ws  ; } right curly bracket
        
      name-separator  = ws %x3A ws  ; : colon
        

value-separator = ws %x2C ws ; , comma

バルブセパレーター= as%ξ2Cws; 、パーティー

Insignificant whitespace is allowed before or after any of the six structural characters.

意味のない空白は、6つの構造文字の前または後に許可されます。

      ws = *(
              %x20 /              ; Space
              %x09 /              ; Horizontal tab
              %x0A /              ; Line feed or New line
              %x0D )              ; Carriage return
        
3. Values
3. 価値観

A JSON value MUST be an object, array, number, or string, or one of the following three literal names:

JSON値は、オブジェクト、配列、数値、文字列、または次の3つのリテラル名のいずれかである必要があります。

false null true

false null tr​​ue

The literal names MUST be lowercase. No other literal names are allowed.

リテラル名は小文字でなければなりません。他のリテラル名は許可されていません。

      value = false / null / true / object / array / number / string
        
      false = %x66.61.6c.73.65   ; false
        
      null  = %x6e.75.6c.6c      ; null
        
      true  = %x74.72.75.65      ; true
        
4. Objects
4. オブジェクト

An object structure is represented as a pair of curly brackets surrounding zero or more name/value pairs (or members). A name is a string. A single colon comes after each name, separating the name from the value. A single comma separates a value from a following name. The names within an object SHOULD be unique.

オブジェクト構造は、0個以上の名前と値のペア(またはメンバー)を囲む中括弧のペアとして表されます。名前は文字列です。各名前の後にコロンを1つ付けて、名前と値を区切ります。 1つのカンマで値と後続の名前を区切ります。オブジェクト内の名前は一意である必要があります。

object = begin-object [ member *( value-separator member ) ] end-object

object = begin-object [member *(value-separator member)] end-object

member = string name-separator value

member =文字列の名前とセパレータの値

An object whose names are all unique is interoperable in the sense that all software implementations receiving that object will agree on the name-value mappings. When the names within an object are not unique, the behavior of software that receives such an object is unpredictable. Many implementations report the last name/value pair only. Other implementations report an error or fail to parse the object, and some implementations report all of the name/value pairs, including duplicates.

名前がすべて一意のオブジェクトは、そのオブジェクトを受け取るすべてのソフトウェア実装が名前と値のマッピングに同意するという意味で相互運用可能です。オブジェクト内の名前が一意でない場合、そのようなオブジェクトを受け取るソフトウェアの動作は予測できません。多くの実装は、姓/値のペアのみを報告します。他の実装は、エラーを報告するか、オブジェクトの解析に失敗します。一部の実装は、重複を含むすべての名前と値のペアを報告します。

JSON parsing libraries have been observed to differ as to whether or not they make the ordering of object members visible to calling software. Implementations whose behavior does not depend on member ordering will be interoperable in the sense that they will not be affected by these differences.

JSON解析ライブラリは、オブジェクトメンバーの順序を呼び出し側のソフトウェアから見えるようにするかどうかに関して異なることが確認されています。動作がメンバーの順序に依存しない実装は、これらの違いの影響を受けないという意味で相互運用可能です。

5. Arrays
5. 配列

An array structure is represented as square brackets surrounding zero or more values (or elements). Elements are separated by commas.

配列構造は、0個以上の値(または要素)を囲む角括弧として表されます。要素はコンマで区切られます。

array = begin-array [ value *( value-separator value ) ] end-array

array = begin-array [value *(value-separator value)] end-array

There is no requirement that the values in an array be of the same type.

配列の値が同じ型である必要はありません。

6. Numbers
6. 数字

The representation of numbers is similar to that used in most programming languages. A number is represented in base 10 using decimal digits. It contains an integer component that may be prefixed with an optional minus sign, which may be followed by a fraction part and/or an exponent part. Leading zeros are not allowed.

数値の表現は、ほとんどのプログラミング言語で使用されているものと似ています。数値は、10進数を使用して10進数で表されます。これには、オプションのマイナス記号を前に付けることができる整数コンポーネントが含まれ、その後に小数部および/または指数部が続く場合があります。先行ゼロは許可されていません。

A fraction part is a decimal point followed by one or more digits.

小数部は、小数点とそれに続く1つ以上の数字です。

An exponent part begins with the letter E in upper or lower case, which may be followed by a plus or minus sign. The E and optional sign are followed by one or more digits.

指数部は大文字または小文字の文字Eで始まり、その後にプラス記号またはマイナス記号が続く場合があります。 Eおよびオプションの符号の後には、1つ以上の数字が続きます。

Numeric values that cannot be represented in the grammar below (such as Infinity and NaN) are not permitted.

以下の文法で表現できない数値(InfinityやNaNなど)は許可されていません。

      number = [ minus ] int [ frac ] [ exp ]
        
      decimal-point = %x2E       ; .
        
      digit1-9 = %x31-39         ; 1-9
        
      e = %x65 / %x45            ; e E
        
      exp = e [ minus / plus ] 1*DIGIT
        

frac = decimal-point 1*DIGIT

frac =小数点1 * DIGIT

      int = zero / ( digit1-9 *DIGIT )
        
      minus = %x2D               ; -
        
      plus = %x2B                ; +
        
      zero = %x30                ; 0
        

This specification allows implementations to set limits on the range and precision of numbers accepted. Since software that implements IEEE 754-2008 binary64 (double precision) numbers [IEEE754] is generally available and widely used, good interoperability can be achieved by implementations that expect no more precision or range than these provide, in the sense that implementations will approximate JSON numbers within the expected precision. A JSON number such as 1E400 or 3.141592653589793238462643383279 may indicate potential interoperability problems, since it suggests that the software that created it expects receiving software to have greater capabilities for numeric magnitude and precision than is widely available.

この仕様により、実装は、受け入れられる数値の範囲と精度に制限を設定できます。 IEEE 754-2008のbinary64(倍精度)数値[IEEE754]を実装するソフトウェアは一般に入手可能で広く使用されているため、実装がJSONに近似するという意味で、これらが提供する以上の精度または範囲を期待しない実装では、優れた相互運用性を実現できます。予想される精度内の数値。 1E400や3.141592653589793238462643383279などのJSON番号は、それを作成したソフトウェアが、受信ソフトウェアが広く利用できるよりも数値の大きさと精度に優れた機能を備えていることを期待していることを示唆しているため、潜在的な相互運用性の問題を示している可能性があります。

Note that when such software is used, numbers that are integers and are in the range [-(2**53)+1, (2**53)-1] are interoperable in the sense that implementations will agree exactly on their numeric values.

このようなソフトウェアが使用される場合、[-(2 ** 53)+1、(2 ** 53)-1]の範囲の整数は、実装がそれらの数値で正確に一致するという意味で相互運用可能です。値。

7. Strings
7. 文字列

The representation of strings is similar to conventions used in the C family of programming languages. A string begins and ends with quotation marks. All Unicode characters may be placed within the quotation marks, except for the characters that must be escaped: quotation mark, reverse solidus, and the control characters (U+0000 through U+001F).

文字列の表現は、プログラミング言語のCファミリで使用されている規則に似ています。文字列は引用符で始まり、引用符で終わります。エスケープする必要のある文字を除いて、すべてのUnicode文字を引用符で囲むことができます:引用符、逆ソリダス、および制御文字(U + 0000からU + 001F)。

Any character may be escaped. If the character is in the Basic Multilingual Plane (U+0000 through U+FFFF), then it may be represented as a six-character sequence: a reverse solidus, followed by the lowercase letter u, followed by four hexadecimal digits that encode the character's code point. The hexadecimal letters A though F can be upper or lower case. So, for example, a string containing only a single reverse solidus character may be represented as "\u005C".

任意の文字をエスケープできます。文字がBasic Multilingual Plane(U + 0000からU + FFFF)内にある場合、6文字のシーケンスとして表されることがあります。キャラクターのコードポイント。 16進数のAからFは大文字でも小文字でもかまいません。したがって、たとえば、単一の逆ソリダス文字のみを含む文字列は、「\ u005C」と表すことができます。

Alternatively, there are two-character sequence escape representations of some popular characters. So, for example, a string containing only a single reverse solidus character may be represented more compactly as "\\".

あるいは、いくつかの一般的な文字の2文字のシーケンスエスケープ表現があります。したがって、たとえば、単一の逆ソリダス文字のみを含む文字列は、 "\\"としてよりコンパクトに表すことができます。

To escape an extended character that is not in the Basic Multilingual Plane, the character is represented as a 12-character sequence, encoding the UTF-16 surrogate pair. So, for example, a string containing only the G clef character (U+1D11E) may be represented as "\uD834\uDD1E".

Basic Multilingual Planeにない拡張文字をエスケープするために、文字は12文字のシーケンスとして表され、UTF-16サロゲートペアをエンコードします。したがって、たとえば、音部記号の文字(U + 1D11E)のみを含む文字列は、「\ uD834 \ uDD1E」と表すことができます。

string = quotation-mark *char quotation-mark

string =引用符* char引用符

      char = unescaped /
          escape (
              %x22 /          ; "    quotation mark  U+0022
              %x5C /          ; \    reverse solidus U+005C
              %x2F /          ; /    solidus         U+002F
              %x62 /          ; b    backspace       U+0008
              %x66 /          ; f    form feed       U+000C
              %x6E /          ; n    line feed       U+000A
              %x72 /          ; r    carriage return U+000D
              %x74 /          ; t    tab             U+0009
              %x75 4HEXDIG )  ; uXXXX                U+XXXX
        
      escape = %x5C              ; \
        
      quotation-mark = %x22      ; "
        
      unescaped = %x20-21 / %x23-5B / %x5D-10FFFF
        
8. String and Character Issues
8. 文字列と文字の問題
8.1. Character Encoding
8.1. 文字コード

JSON text SHALL be encoded in UTF-8, UTF-16, or UTF-32. The default encoding is UTF-8, and JSON texts that are encoded in UTF-8 are interoperable in the sense that they will be read successfully by the maximum number of implementations; there are many implementations that cannot successfully read texts in other encodings (such as UTF-16 and UTF-32).

JSONテキストは、UTF-8、UTF-16、またはUTF-32でエンコードする必要があります。デフォルトのエンコードはUTF-8であり、UTF-8でエンコードされたJSONテキストは、実装の最大数で正常に読み取られるという意味で相互運用可能です。他のエンコーディング(UTF-16やUTF-32など)でテキストを正常に読み取ることができない多くの実装があります。

Implementations MUST NOT add a byte order mark to the beginning of a JSON text. In the interests of interoperability, implementations that parse JSON texts MAY ignore the presence of a byte order mark rather than treating it as an error.

実装では、JSONテキストの先頭にバイトオーダーマークを追加しないでください。相互運用性のために、JSONテキストを解析する実装は、バイトオーダーマークの存在をエラーとして扱うのではなく、無視する場合があります。

8.2. Unicode Characters
8.2. Unicode文字

When all the strings represented in a JSON text are composed entirely of Unicode characters [UNICODE] (however escaped), then that JSON text is interoperable in the sense that all software implementations that parse it will agree on the contents of names and of string values in objects and arrays.

JSONテキストで表されるすべての文字列が完全にUnicode文字[UNICODE]で構成される場合(ただしエスケープされます)、そのJSONテキストは、それを解析するすべてのソフトウェア実装が名前と文字列値の内容に同意するという意味で相互運用可能ですオブジェクトと配列。

However, the ABNF in this specification allows member names and string values to contain bit sequences that cannot encode Unicode characters; for example, "\uDEAD" (a single unpaired UTF-16 surrogate). Instances of this have been observed, for example, when a library truncates a UTF-16 string without checking whether the truncation split a surrogate pair. The behavior of software that receives JSON texts containing such values is unpredictable; for example, implementations might return different values for the length of a string value or even suffer fatal runtime exceptions.

ただし、この仕様のABNFでは、メンバー名と文字列値に、Unicode文字をエンコードできないビットシーケンスを含めることができます。たとえば、 "\ uDEAD"(単一の対になっていないUTF-16サロゲート)。たとえば、ライブラリが切り捨てによってサロゲートペアを分割したかどうかを確認せずに、ライブラリがUTF-16文字列を切り捨てた場合に、このインスタンスが確認されています。このような値を含むJSONテキストを受け取るソフトウェアの動作は予測できません。たとえば、実装は文字列値の長さに対して異なる値を返す場合や、致命的なランタイム例外が発生する場合もあります。

8.3. String Comparison
8.3. 文字列比較

Software implementations are typically required to test names of object members for equality. Implementations that transform the textual representation into sequences of Unicode code units and then perform the comparison numerically, code unit by code unit, are interoperable in the sense that implementations will agree in all cases on equality or inequality of two strings. For example, implementations that compare strings with escaped characters unconverted may incorrectly find that "a\\b" and "a\u005Cb" are not equal.

通常、ソフトウェア実装は、オブジェクトメンバーの名前が等しいかどうかをテストするために必要です。テキスト表現をUnicodeコード単位のシーケンスに変換し、コード単位ごとに数値的に比較する実装は、2つの文字列が等しいか等しくない場合に実装がすべての場合で一致するという意味で相互運用可能です。たとえば、文字列を未変換のエスケープ文字と比較する実装では、「a \\ b」と「a \ u005Cb」が等しくないことが誤って検出される場合があります。

9. Parsers
9. パーサー

A JSON parser transforms a JSON text into another representation. A JSON parser MUST accept all texts that conform to the JSON grammar. A JSON parser MAY accept non-JSON forms or extensions.

JSONパーサーは、JSONテキストを別の表現に変換します。 JSONパーサーは、JSON文法に準拠するすべてのテキストを受け入れる必要があります。 JSONパーサーは、JSON以外のフォームまたは拡張を受け入れることができます(MAY)。

An implementation may set limits on the size of texts that it accepts. An implementation may set limits on the maximum depth of nesting. An implementation may set limits on the range and precision of numbers. An implementation may set limits on the length and character contents of strings.

実装は、受け入れるテキストのサイズに制限を設定する場合があります。実装では、ネストの最大深度に制限を設定できます。実装では、数値の範囲と精度に制限を設定できます。実装によって、文字列の長さと文字の内容に制限が設定される場合があります。

10. Generators
10. 発電機

A JSON generator produces JSON text. The resulting text MUST strictly conform to the JSON grammar.

JSONジェネレーターはJSONテキストを生成します。結果のテキストは、JSON文法に厳密に従う必要があります。

11. IANA Considerations
11. IANAに関する考慮事項

The MIME media type for JSON text is application/json.

JSONテキストのMIMEメディアタイプはapplication / jsonです。

Type name: application

タイプ名:アプリケーション

Subtype name: json

サブタイプ名:json

Required parameters: n/a

必須パラメーター:なし

Optional parameters: n/a

オプションのパラメーター:n / a

Encoding considerations: binary

エンコーディングに関する考慮事項:バイナリ

Security considerations: See [RFC7158], Section 12.

セキュリティに関する考慮事項:[RFC7158]のセクション12をご覧ください。

Interoperability considerations: Described in [RFC7158]

相互運用性に関する考慮事項:[RFC7158]で説明

Published specification: [RFC7158]

公開された仕様:[RFC7158]

Applications that use this media type: JSON has been used to exchange data between applications written in all of these programming languages: ActionScript, C, C#, Clojure, ColdFusion, Common Lisp, E, Erlang, Go, Java, JavaScript, Lua, Objective CAML, Perl, PHP, Python, Rebol, Ruby, Scala, and Scheme.

このメディアタイプを使用するアプリケーション:JSONは、ActionScript、C、C#、Clojure、ColdFusion、Common Lisp、E、Erlang、Go、Java、JavaScript、Lua、Objectiveのすべてのプログラミング言語で記述されたアプリケーション間でデータを交換するために使用されていますCAML、Perl、PHP、Python、Rebol、Ruby、Scala、Scheme。

   Additional information:
      Magic number(s): n/a
      File extension(s): .json
      Macintosh file type code(s): TEXT
        

Person & email address to contact for further information: IESG <iesg@ietf.org>

詳細について連絡する人とメールアドレス:IESG <iesg@ietf.org>

Intended usage: COMMON

使用目的:COMMON

Restrictions on usage: none

使用上の制限:なし

Author: Douglas Crockford <douglas@crockford.com>

作成者:Douglas Crockford <douglas@crockford.com>

Change controller: IESG <iesg@ietf.org>

変更コントローラー:IESG <iesg@ietf.org>

Note: No "charset" parameter is defined for this registration. Adding one really has no effect on compliant recipients.

注:この登録には「charset」パラメーターは定義されていません。 1つを追加しても、準拠する受信者には実際には影響しません。

12. Security Considerations
12. セキュリティに関する考慮事項

Generally, there are security issues with scripting languages. JSON is a subset of JavaScript but excludes assignment and invocation.

一般に、スクリプト言語にはセキュリティの問題があります。 JSONはJavaScriptのサブセットですが、割り当てと呼び出しは除外されています。

Since JSON's syntax is borrowed from JavaScript, it is possible to use that language's "eval()" function to parse JSON texts. This generally constitutes an unacceptable security risk, since the text could contain executable code along with data declarations. The same consideration applies to the use of eval()-like functions in any other programming language in which JSON texts conform to that language's syntax.

JSONの構文はJavaScriptから借用されているため、その言語の「eval()」関数を使用してJSONテキストを解析できます。テキストにはデータ宣言とともに実行可能コードが含まれる可能性があるため、これは一般に許容できないセキュリティリスクになります。 JSONテキストがその言語の構文に準拠している他のプログラミング言語でのeval()のような関数の使用にも同じ考慮事項が適用されます。

13. Examples
13. 例

This is a JSON object:

これはJSONオブジェクトです:

      {
        "Image": {
            "Width":  800,
            "Height": 600,
            "Title":  "View from 15th Floor",
            "Thumbnail": {
                "Url":    "http://www.example.com/image/481989943",
                "Height": 125,
                "Width":  100
            },
            "Animated" : false,
            "IDs": [116, 943, 234, 38793]
          }
      }
        

Its Image member is an object whose Thumbnail member is an object and whose IDs member is an array of numbers.

そのImageメンバーは、Thumbnailメンバーがオブジェクトであり、IDメンバーが数値の配列であるオブジェクトです。

This is a JSON array containing two objects:

これは、2つのオブジェクトを含むJSON配列です。

      [
        {
           "precision": "zip",
           "Latitude":  37.7668,
           "Longitude": -122.3959,
           "Address":   "",
           "City":      "SAN FRANCISCO",
           "State":     "CA",
           "Zip":       "94107",
           "Country":   "US"
        },
        {
           "precision": "zip",
           "Latitude":  37.371991,
           "Longitude": -122.026020,
           "Address":   "",
           "City":      "SUNNYVALE",
           "State":     "CA",
           "Zip":       "94085",
           "Country":   "US"
        }
      ]
        

Here are three small JSON texts containing only values:

次に、値のみを含む3つの小さなJSONテキストを示します。

"Hello world!"

"こんにちは世界!"

42

42

true

本当

14. Contributors
14. 貢献者

RFC 4627 was written by Douglas Crockford. This document was constructed by making a relatively small number of changes to that document; thus, the vast majority of the text here is his.

RFC 4627は、Douglas Crockfordによって作成されました。このドキュメントは、そのドキュメントに比較的少数の変更を加えることによって作成されました。したがって、ここのテキストの大部分は彼のものです。

15. References
15. 参考文献
15.1. Normative References
15.1. 引用文献

[IEEE754] IEEE, "IEEE Standard for Floating-Point Arithmetic", IEEE Standard 754, August 2008, <http://grouper.ieee.org/groups/754/>.

[IEEE754] IEEE、「IEEE Standard for Floating-Point Arithmetic」、IEEE Standard 754、2008年8月、<http://grouper.ieee.org/groups/754/>。

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[RFC2119] Bradner、S。、「要件レベルを示すためにRFCで使用するキーワード」、BCP 14、RFC 2119、1997年3月。

[RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", STD 68, RFC 5234, January 2008.

[RFC5234] Crocker、D。およびP. Overell、「構文仕様の拡張BNF:ABNF」、STD 68、RFC 5234、2008年1月。

[UNICODE] The Unicode Consortium, "The Unicode Standard", <http://www.unicode.org/versions/latest/>.

[UNICODE] Unicodeコンソーシアム、「The Unicode Standard」、<http://www.unicode.org/versions/latest/>。

15.2. Informative References
15.2. 参考引用

[ECMA-262] Ecma International, "ECMAScript Language Specification Edition 5.1", Standard ECMA-262, June 2011, <http://www.ecma-international.org/publications/standards/ Ecma-262.htm>.

[ECMA-262] Ecma International、「ECMAScript Language Specification Edition 5.1」、Standard ECMA-262、2011年6月、<http://www.ecma-international.org/publications/standards/ Ecma-262.htm>。

[ECMA-404] Ecma International, "The JSON Data Interchange Format", Standard ECMA-404, October 2013, <http://www.ecma-international.org/publications/standards/ Ecma-404.htm>.

[ECMA-404] Ecma International、「The JSON Data Interchange Format」、Standard ECMA-404、2013年10月、<http://www.ecma-international.org/publications/standards/ Ecma-404.htm>。

[Err3607] RFC Errata, Errata ID 3607, RFC 3607, <http://www.rfc-editor.org>.

[Err3607] RFC Errata、Errata ID 3607、RFC 3607、<http://www.rfc-editor.org>。

[Err607] RFC Errata, Errata ID 607, RFC 607, <http://www.rfc-editor.org>.

[Err607] RFC Errata、Errata ID 607、RFC 607、<http://www.rfc-editor.org>。

[RFC4627] Crockford, D., "The application/json Media Type for JavaScript Object Notation (JSON)", RFC 4627, July 2006.

[RFC4627] Crockford、D。、「JavaScript Object Notation(JSON)のアプリケーション/ jsonメディアタイプ」、RFC 4627、2006年7月。

Appendix A. Changes from RFC 4627
付録A. RFC 4627からの変更点

This section lists changes between this document and the text in RFC 4627.

このセクションでは、このドキュメントとRFC 4627のテキストとの間の変更点を示します。

o Changed the title and abstract of the document.

o ドキュメントのタイトルと要約を変更しました。

o Changed the reference to [UNICODE] to be not version specific.

o 参照をバージョン固有ではない[UNICODE]に変更しました。

o Added a "Specifications of JSON" section.

o 「JSONの仕様」セクションを追加しました。

o Added an "Introduction to This Revision" section.

o 「このリビジョンの概要」セクションを追加しました。

o Changed the definition of "JSON text" so that it can be any JSON value, removing the constraint that it be an object or array.

o 「JSONテキスト」の定義を変更して、任意のJSON値にできるようにし、オブジェクトまたは配列であるという制約を削除しました。

o Added language about duplicate object member names, member ordering, and interoperability.

o 重複するオブジェクトメンバー名、メンバーの順序、および相互運用性に関する言語を追加しました。

o Clarified the absence of a requirement that values in an array be of the same JSON type.

o 配列の値が同じJSON型であるという要件がないことを明確にしました。

o Applied erratum #607 from RFC 4627 to correctly align the artwork for the definition of "object".

o RFC 4627のエラータ#607を適用して、アートワークを「オブジェクト」の定義に正しく揃えます。

o Changed "as sequences of digits" to "in the grammar below" in the "Numbers" section, and made base-10-ness explicit.

o 「数字」セクションの「数字列として」を「以下の文法内」に変更し、10進法を明示しました。

o Added language about number interoperability as a function of IEEE754, and added an IEEE754 reference.

o IEEE754の関数としての番号の相互運用性に関する言語を追加し、IEEE754リファレンスを追加しました。

o Added language about interoperability and Unicode characters and about string comparisons. To do this, turned the old "Encoding" section into a "String and Character Issues" section, with three subsections: "Character Encoding", "Unicode Characters", and "String Comparison".

o 相互運用性とUnicode文字、および文字列比較に関する言語を追加しました。これを行うには、古い「エンコーディング」セクションを「文字列と文字の問題」セクションに変更し、3つのサブセクション「文字エンコーディング」、「Unicode文字」、および「文字列比較」を追加しました。

o Changed guidance in the "Parsers" section to point out that implementations may set limits on the range "and precision" of numbers.

o 「パーサー」セクションのガイダンスを変更して、実装が数値の「範囲と精度」に制限を設定する可能性があることを指摘しました。

o Updated and tidied the "IANA Considerations" section.

o 「IANAの考慮事項」セクションを更新および整理。

o Made a real "Security Considerations" section and lifted the text out of the previous "IANA Considerations" section.

o 実際の「セキュリティに関する考慮事項」セクションを作成し、前の「IANAに関する考慮事項」セクションからテキストを削除しました。

o Applied erratum #3607 from RFC 4627 by removing the security consideration that begins "A JSON text can be safely passed" and the JavaScript code that went with that consideration.

o RFC 4627のエラータ#3607を適用し、「JSONテキストを安全に渡すことができる」というセキュリティの考慮事項と、その考慮事項に対応したJavaScriptコードを削除しました。

o Added a note to the "Security Considerations" section pointing out the risks of using the "eval()" function in JavaScript or any other language in which JSON texts conform to that language's syntax.

o JavaScriptまたは「JSONテキストがその言語の構文に準拠するその他の言語で「eval()」関数を使用するリスクを指摘する「セキュリティの考慮事項」セクションに注記を追加しました。

o Added a note to the "IANA Considerations" clarifying the absence of a "charset" parameter for the application/json media type.

o 「IANAの考慮事項」に、application / jsonメディアタイプの「charset」パラメータがないことを明確にする注記を追加しました。

o Changed "100" to 100 and added a boolean field, both in the first example.

o 最初の例で、 "100"を100に変更し、ブールフィールドを追加しました。

o Added examples of JSON texts with simple values, neither objects nor arrays.

o オブジェクトでも配列でもない単純な値を持つJSONテキストの例を追加しました。

o Added a "Contributors" section crediting Douglas Crockford.

o ダグラス・クロックフォードの功績を称える「寄稿者」セクションを追加しました。

o Added a reference to RFC 4627.

o RFC 4627への参照を追加しました。

o Moved the ECMAScript reference from Normative to Informative and updated it to reference ECMAScript 5.1, and added a reference to ECMA 404.

o ECMAScript参照を標準から情報に移動し、ECMAScript 5.1を参照するように更新し、ECMA 404への参照を追加しました。

Author's Address

著者のアドレス

Tim Bray (editor) Google, Inc.

ティム・ブレイ(編集者)Google、Inc.

   EMail: tbray@textuality.com