股票xd开头是什么意思| 什么叫肺纤维化| 大便不成型吃什么药| 人言可畏是什么意思| 骨质疏松吃什么钙片好| 隐翅虫咬人后用什么药| 康什么大道| 肠胃不好适合喝什么茶| 黄水晶五行属什么| 成人高考是什么| 荷花是什么季节| 落井下石什么意思| 流年是什么意思| 钛对人体有什么好处| 霉菌性阴道炎用什么药好| 什么是小暑| 老年人尿血是什么原因| 中风是什么| 后装治疗是什么意思| 签退是什么意思| 萎缩性胃炎吃什么药能治好| 女人什么眉毛最有福气| 心机血缺血是什么症状| 孕妇手麻是什么原因引起的| 为什么会梦见前男友| 胃发胀是什么原因| 什么提示你怀了女宝宝| 入定是什么意思| 脂肪肝适合吃什么水果| 什么是朱砂痣| 黄鳝不能和什么一起吃| zara是什么品牌| 零申报是什么意思| 睡前一杯牛奶有什么好处| 来月经为什么会拉肚子| 宝宝吃的益生菌什么牌子好| 苦海翻起爱恨是什么歌| 肺有问题会出现什么症状| 封面是什么意思| 下体瘙痒用什么药| 窦性心动过速是什么意思| 朱砂五行属什么| 内痔是什么| 甲低有什么症状表现| 老花眼是什么症状| 2型糖尿病是什么意思| 5.19是什么星座| 经常口臭的人是什么原因引起的| 阿玛尼是什么品牌| 月经量减少是什么原因| 长鸡眼是什么原因| 中暑发烧吃什么药| 十一月六号是什么星座| 牙龈充血是什么原因| 为什么作什么的成语| 脑供血不足什么症状| 两胸中间疼是什么原因| 发五行属什么| 淋巴细胞升高说明什么| 小孩喉咙发炎吃什么药好| 英雄的动物是什么生肖| 破伤风挂什么科| 肝寒吃什么中成药| 羊奶粉和牛奶粉有什么区别| 热辐射是什么| 什么是忧郁症| 麦冬有什么功效| 什么的眨眼| 05年属鸡的是什么命| 没腿毛的男人代表什么| 什么是外围| 黄水疮是什么原因引起的| 吃什么能补雌激素| 无创和羊水穿刺有什么区别| 男人吃四环素治什么病| ebay是什么| 土地兼并是什么意思| cbt是什么意思| 盆腔积液吃什么消炎药| 男人吃西红柿有什么好处| 心肌缺血吃什么食物| 梦见花生是什么意思| 爸爸过生日送什么礼物| 多囊为什么要吃避孕药| 下午三点到四点是什么时辰| 周知是什么意思| 灿字五行属什么| 逆转是什么意思| nmol是什么单位| 任性妄为是什么意思| 日进斗金是什么意思| 什么叫心悸| 婢女是什么意思| 蝴蝶代表什么生肖| 涂素颜霜之前要涂什么| 涤纶是什么| 喝酒前喝什么不容易醉又不伤胃| 男才女貌是什么意思| 惊厥是什么病| 水命和什么命最配| 女人右眼跳是什么预兆| fred是什么牌子| 吃什么水果降火最快| 检查痛风挂什么科| 残局是什么意思| 近视是什么意思| 下肢浮肿是什么原因引起的| 舌面上有裂纹是什么病| 什么样的疤痕影响当兵| 小肠ct能检查什么病| 吃什么降羊水最快| 分娩是什么意思啊| 什么的水井| 老被蚊子咬是什么原因| 洋桔梗的花语是什么| 乌龟为什么喜欢叠罗汉| 雌性激素是什么| 各位同仁用在什么场合| 脚经常抽筋是什么原因| 一切有为法是什么意思| 滑石粉有什么作用| 鳌虾吃什么| 谷丙转氨酶是什么意思| 舒服的意思是什么| 喝什么能补肾| 休克是什么| 手指甲看什么科室| 什么是舍利| 霸王餐是什么意思| 脚肿了是什么原因引起的| 做病理是什么意思| 什么情况下需要根管治疗| 四书五经是什么| 长乘宽乘高算的是什么| 凤凰是什么生肖| 口腔溃疡用什么药最好| 前列腺有什么作用| 10月10是什么星座| 无极调光是什么意思| 盐酸利多卡因是什么药| 盆腔炎挂什么科| 吃饭后胃疼是什么原因| 孕妇梦见西瓜是什么意思| 鼠和什么属相最配对| 各位同仁用在什么场合| 情志是什么意思| jimmy是什么意思| 门庭若什么| 迷恋一个人说明什么| 手抖是因为什么| 癌抗原125是什么意思| 尿是褐色的是什么原因| 阉了是什么意思| 吃完龙虾不能吃什么| 存款准备金率是什么意思| 皮蛋和什么不能一起吃| 辛辣的辛是什么意思| 什么是血液病| 为什么口腔溃疡| 女人小腹坠痛是什么原因| 舌头有齿痕是什么原因| 股票换手率是什么意思| 尿毒症吃什么最好| 金字旁目字读什么| 虫见读什么| 挽留是什么意思| 什么狗不咬人| 幽门螺杆菌抗体阳性什么意思| 什么是马甲线| 毓婷是什么药| 补血吃什么药最快最好| 支原体感染是什么症状| 女人乳房疼是什么原因| 鸡蛋和什么不能一起吃吗| 什么症状吃肝胃气痛片| 黄历中的入宅是什么意思| 女性吃辅酶q10有什么好处| 7月8号是什么日子| 咽喉炎挂什么科| 鳞状上皮细胞是什么| 沉珂是什么意思| 什么是数位| 麻油跟香油什么区别| 十滴水是什么| 康熙姓什么| 土地出让金是什么意思| 为什么叫夺命大乌苏| 情未了什么意思| 过生日吃什么菜寓意好| 检查甲状腺挂什么科| 呼吸衰竭是什么意思| 禾加末念什么| 属相是什么| 2021年是什么命| 什么是摇滚| 8月14日是什么星座| 80年属猴的是什么命| 石楠花是什么味道| 检查包皮挂什么科| 送医生什么礼物好| 肩膀疼什么原因| 什么是夫妻共同财产| 工装裤搭配什么上衣| 蓝莓是什么颜色| 金牛男喜欢什么样的女生| 阴虱有什么症状| 夏天结婚新郎穿什么衣服图片| 在农村做什么生意好| 公司董事是什么职务| 儿童乘坐高铁需要什么证件| 陆陆续续是什么意思| 浮水是什么意思| 射进去是什么感觉| 寻麻疹不能吃什么| 生理期可以吃什么水果| 偏激是什么意思| 雀子是什么意思| 鼻窦炎有什么症状表现| 白带多用什么药效果好| 甲流是什么病| 藏青色配什么颜色好看| 头发为什么会分叉| 巧克力有什么功效与作用| 颈动脉彩超能查出什么| 回乡偶书的偶书是什么意思| 桑葚有什么功效和作用| 嘴歪是什么引起的| 下一年是什么生肖| 鳞状上皮增生什么意思| 风起云涌是什么意思| 前列腺吃什么药效果好| 风花雪月是什么意思| 过敏性鼻炎吃什么药能快速缓解| 绮字五行属什么| 靴型心见于什么病| 血糖高喝酒有什么影响| 小腿肿看什么科| 脚趾麻是什么病的前兆| 什么然而生| 水瓶座的幸运色是什么颜色| 吃什么补肾最快最好| 什么是经络| audrey是什么意思| 7月15日是什么节日| 总胆红素高是什么原因| 养生馆起什么名字好| 梦见钱包丢了是什么意思| 不丹为什么不跟中国建交| 什么水晶招财| 阴道瘙痒什么原因| 一吃东西就牙疼是什么原因引起的| 痔疮用什么药好| 脾胃虚寒吃什么药| 右眼睛跳是什么意思| 维生素b什么时候吃| 羊肉不能和什么水果一起吃| 狮子座与什么星座最配| 肚脐有分泌物还发臭是什么原因| 散光和近视有什么区别| 嘴里有粘液是什么原因| 心安是什么意思| 兴奋是什么意思| ab型血生的孩子是什么血型| 少一颗牙齿有什么影响| 百度Jump to content

法国南部恐怖袭击造成3死16伤

From Wikipedia, the free encyclopedia
百度 任何人,倘能每天抽出几分钟时间,不论枕上、厕上、舟车上,任何处,可拿出论语,读其一章或二章。

JavaScript Object Notation
The JSON logo is a M?bius strip
The JSON logo is a M?bius strip
Filename extension
.json
Internet media type
application/json
Type codeTEXT
Uniform Type Identifier (UTI)public.json
Type of formatData interchange
Extended fromJavaScript
StandardSTD 90 (RFC 8259), ECMA-404, ISO/IEC 21778:2017
Open format?Yes
Websitejson.org

JSON (JavaScript Object Notation, pronounced /?d?e?s?n/ or /?d?e??s?n/) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of name–value pairs and arrays (or other serializable values). It is a commonly used data format with diverse uses in electronic data interchange, including that of web applications with servers.

JSON is a language-independent data format. It was derived from JavaScript, but many modern programming languages include code to generate and parse JSON-format data. JSON filenames use the extension .json.

Douglas Crockford originally specified the JSON format in the early 2000s.[1] He and Chip Morningstar sent the first JSON message in April 2001.

Naming and pronunciation

[edit]

The 2017 international standard (ECMA-404 and ISO/IEC 21778:2017) specifies that "JSON" is "pronounced /?d?e?.s?n/, as in 'Jason and The Argonauts'".[2][3] The first (2013) edition of ECMA-404 did not address the pronunciation.[4] The UNIX and Linux System Administration Handbook states, "Douglas Crockford, who named and promoted the JSON format, says it's pronounced like the name Jason. But somehow, 'JAY-sawn'[note 1] seems to have become more common in the technical community."[5] Crockford said in 2011, "There's a lot of argument about how you pronounce that, but I strictly don't care."[1]

Standards

[edit]

After RFC 4627 had been available as its "informational" specification since 2006, JSON was first standardized in 2013, as ECMA-404.[4] RFC 8259, published in 2017, is the current version of the Internet Standard STD 90, and it remains consistent with ECMA-404.[6] That same year, JSON was also standardized as ISO/IEC 21778:2017.[2] The ECMA and ISO/IEC standards describe only the allowed syntax, whereas the RFC covers some security and interoperability considerations.[7]

History

[edit]
Douglas Crockford at the Yahoo Building (2007)

JSON grew out of a need for a real-time server-to-browser session communication protocol without using browser plugins such as Flash or Java applets, the dominant methods used in the early 2000s.[8]

Crockford first specified and popularized the JSON format.[1] The acronym originated at State Software, a company cofounded by Crockford and others in March 2001. The cofounders agreed to build a system that used standard browser capabilities and provided an abstraction layer for Web developers to create stateful Web applications that had a persistent duplex connection to a Web server by holding two Hypertext Transfer Protocol (HTTP) connections open and recycling them before standard browser time-outs if no further data were exchanged. The cofounders had a round-table discussion and voted on whether to call the data format JSML (JavaScript Markup Language) or JSON (JavaScript Object Notation), as well as under what license type to make it available. The JSON.org[9] website was launched in 2001. In December 2005, Yahoo! began offering some of its Web services in JSON.[10]

A precursor to the JSON libraries was used in a children's digital asset trading game project named Cartoon Orbit at Communities.com [citation needed] which used a browser side plug-in with a proprietary messaging format to manipulate DHTML elements. Upon discovery of early Ajax capabilities, digiGroups, Noosh, and others used frames to pass information into the user browsers' visual field without refreshing a Web application's visual context, realizing real-time rich Web applications using only the standard HTTP, HTML, and JavaScript capabilities of Netscape 4.0.5+ and Internet Explorer 5+. Crockford then found that JavaScript could be used as an object-based messaging format for such a system. The system was sold to Sun Microsystems, Amazon.com, and EDS.

JSON was based on a subset of the JavaScript scripting language (specifically, Standard ECMA-262 3rd Edition—December 1999[11]) and is commonly used with JavaScript, but it is a language-independent data format. Code for parsing and generating JSON data is readily available in many programming languages. JSON's website lists JSON libraries by language.

In October 2013, Ecma International published the first edition of its JSON standard ECMA-404.[4] That same year, RFC 7158 used ECMA-404 as a reference. In 2014, RFC 7159 became the main reference for JSON's Internet uses, superseding RFC 4627 and RFC 7158 (but preserving ECMA-262 and ECMA-404 as main references). In November 2017, ISO/IEC JTC 1/SC 22 published ISO/IEC 21778:2017[2] as an international standard. On December 13, 2017, the Internet Engineering Task Force obsoleted RFC 7159 when it published RFC 8259, which is the current version of the Internet Standard STD 90.[12][13]

Crockford added a clause to the JSON license stating, "The Software shall be used for Good, not Evil", in order to open-source the JSON libraries while mocking corporate lawyers and those who are overly pedantic. On the other hand, this clause led to license compatibility problems of the JSON license with other open-source licenses since open-source software and free software usually imply no restrictions on the purpose of use.[14]

Syntax

[edit]

The following example shows a possible JSON representation describing a person.

{
  "first_name": "John",
  "last_name": "Smith",
  "is_alive": true,
  "age": 27,
  "address": {
    "street_address": "21 2nd Street",
    "city": "New York",
    "state": "NY",
    "postal_code": "10021-3100"
  },
  "phone_numbers": [
    {
      "type": "home",
      "number": "212 555-1234"
    },
    {
      "type": "office",
      "number": "646 555-4567"
    }
  ],
  "children": [
    "Catherine",
    "Thomas",
    "Trevor"
  ],
  "spouse": null
}

Character encoding

[edit]

Although Crockford originally asserted that JSON is a strict subset of JavaScript and ECMAScript,[15] his specification actually allows valid JSON documents that are not valid JavaScript; JSON allows the Unicode line terminators U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR to appear unescaped in quoted strings, while ECMAScript 2018 and older do not.[16][17] This is a consequence of JSON disallowing only "control characters". For maximum portability, these characters are backslash-escaped.

JSON exchange in an open ecosystem must be encoded in UTF-8.[6] The encoding supports the full Unicode character set, including those characters outside the Basic Multilingual Plane (U+0000 to U+FFFF). However, if escaped, those characters must be written using UTF-16 surrogate pairs. For example, to include the Emoji character U+1F610 ?? NEUTRAL FACE in JSON:

{ "face": "??" }
// or
{ "face": "\uD83D\uDE10" }

JSON became a strict subset of ECMAScript as of the language's 2019 revision.[17][18]

Data types

[edit]

JSON's basic data types are:

  • Number: a signed decimal number that may contain a fractional part and may use exponential E notation but cannot include non-numbers such as NaN. The format makes no distinction between integer and floating-point. JavaScript uses IEEE-754 double-precision floating-point format for all its numeric values (later also supporting BigInt[19]), but other languages implementing JSON may encode numbers differently.
  • String: a sequence of zero or more Unicode characters. Strings are delimited with double quotation marks and support a backslash escaping syntax.
  • Boolean: either of the values true or false
  • Array: an ordered list of zero or more elements, each of which may be of any type. Arrays use square bracket notation with comma-separated elements.
  • Object: a collection of name–value pairs where the names (also called keys) are strings. The current ECMA standard states, "The JSON syntax does not impose any restrictions on the strings used as names, does not require that name strings be unique, and does not assign any significance to the ordering of name/value pairs."[20] Objects are delimited with curly brackets and use commas to separate each pair, while within each pair, the colon ":" character separates the key or name from its value.
  • null: an empty value, using the word null

Whitespace is allowed and ignored around or between syntactic elements (values and punctuation, but not within a string value). Four specific characters are considered whitespace for this purpose: space, horizontal tab, line feed, and carriage return. In particular, the byte order mark must not be generated by a conforming implementation (though it may be accepted when parsing JSON). JSON does not provide syntax for comments.[21]

Early versions of JSON (such as specified by RFC 4627) required that a valid JSON text must consist of only an object or an array type, which could contain other types within them. This restriction was dropped in RFC 7158, where a JSON text was redefined as any serialized value.

Numbers in JSON are agnostic with regard to their representation within programming languages. While this allows for numbers of arbitrary precision to be serialized, it may lead to portability issues. For example, since no differentiation is made between integer and floating-point values, some implementations may treat 42, 42.0, and 4.2E+1 as the same number, while others may not. The JSON standard makes no requirements regarding implementation details such as overflow, underflow, loss of precision, rounding, or signed zeros, but it does recommend expecting no more than IEEE 754 binary64 precision for "good interoperability". There is no inherent precision loss in serializing a machine-level binary representation of a floating-point number (like binary64) into a human-readable decimal representation (like numbers in JSON) and back; there exist published algorithms to do this conversion exactly and optimally.[22]

Comments were intentionally excluded from JSON. In 2012, Douglas Crockford described his design decision thus: "I removed comments from JSON because I saw people were using them to hold parsing directives, a practice which would have destroyed interoperability."[21]

JSON disallows "trailing commas", a comma after the last value inside a data structure.[23] Trailing commas are a common feature of JSON derivatives to improve ease of use.[24]

Interoperability

[edit]

RFC 8259 describes certain aspects of JSON syntax that, while legal per the specifications, can cause interoperability problems.

  • Certain JSON implementations only accept JSON texts representing an object or an array. For interoperability, applications interchanging JSON should transmit messages that are objects or arrays.
  • The specifications allow JSON objects that contain multiple members with the same name. The behavior of implementations processing objects with duplicate names is unpredictable. For interoperability, applications should avoid duplicate names when transmitting JSON objects.
  • The specifications specifically say that the order of members in JSON objects is not significant. For interoperability, applications should avoid assigning meaning to member ordering even if the parsing software makes that ordering visible.
  • While the specifications place no limits on the magnitude or precision of JSON number literals, the widely used JavaScript implementation stores them as IEEE754 "binary64" quantities. For interoperability, applications should avoid transmitting numbers that cannot be represented in this way, for example, 1E400 or 3.141592653589793238462643383279.
  • While the specifications do not constrain the character encoding of the Unicode characters in a JSON text, the vast majority of implementations assume UTF-8 encoding; for interoperability, applications should always and only encode JSON messages in UTF-8.
  • The specifications do not forbid transmitting byte sequences that incorrectly represent Unicode characters. For interoperability, applications should transmit messages containing no such byte sequences.
  • The specification does not constrain how applications go about comparing Unicode strings. For interoperability, applications should always perform such comparisons code unit by code unit.

In 2015, the IETF published RFC 7493, describing the "I-JSON Message Format", a restricted profile of JSON that constrains the syntax and processing of JSON to avoid, as much as possible, these interoperability issues.

Semantics

[edit]

While JSON provides a syntactic framework for data interchange, unambiguous data interchange also requires agreement between producer and consumer on the semantics of specific use of the JSON syntax.[25] One example of where such an agreement is necessary is the serialization of data types that are not part of the JSON standard, for example, dates and regular expressions.

Metadata and schema

[edit]

The official MIME type for JSON text is application/json,[26] and most modern implementations have adopted this. Legacy MIME types include text/json, text/x-json, and text/javascript.[27] The standard filename extension is .json.[28]

JSON Schema specifies a JSON-based format to define the structure of JSON data for validation, documentation, and interaction control. It provides a contract for the JSON data required by a given application and how that data can be modified.[29] JSON Schema is based on the concepts from XML Schema (XSD) but is JSON-based. As in XSD, the same serialization/deserialization tools can be used both for the schema and data, and it is self-describing. It is specified in an Internet Draft at the IETF, with the latest version as of 2024 being "Draft 2020-12".[30] There are several validators available for different programming languages,[31] each with varying levels of conformance.

The JSON standard does not support object references, but an IETF draft standard for JSON-based object references exists.[32]

Uses

[edit]

JSON-RPC is a remote procedure call (RPC) protocol built on JSON, as a replacement for XML-RPC or SOAP. It is a simple protocol that defines only a handful of data types and commands. JSON-RPC lets a system send notifications (information to the server that does not require a response) and multiple calls to the server that can be answered out of order.

Asynchronous JavaScript and JSON (or AJAJ) refers to the same dynamic web page methodology as Ajax, but instead of XML, JSON is the data format. AJAJ is a web development technique that provides for the ability of a web page to request new data after it has loaded into the web browser. Typically, it renders new data from the server in response to user actions on that web page. For example, what the user types into a search box, client-side code then sends to the server, which immediately responds with a drop-down list of matching database items.

JSON has seen ad hoc usage as a configuration language. However, it does not support comments. In 2012, Douglas Crockford, JSON creator, had this to say about comments in JSON when used as a configuration language: "I know that the lack of comments makes some people sad, but it shouldn't. Suppose you are using JSON to keep configuration files, which you would like to annotate. Go ahead and insert all the comments you like. Then pipe it through JSMin[33] before handing it to your JSON parser."[21]

MongoDB uses JSON-like data for its document-oriented database.

Some relational databases have added support for native JSON data types, such as JSONB in PostgreSQL[34] and JSON in MySQL.[35] This allows developers to insert JSON data directly without having to convert it to another format.

Safety

[edit]

JSON being a subset of JavaScript can lead to the misconception that it is safe to pass JSON texts to the JavaScript eval() function. This is not safe, due to certain valid JSON texts, specifically those containing U+2028 LINE SEPARATOR or U+2029 PARAGRAPH SEPARATOR, not being valid JavaScript code until JavaScript specifications were updated in 2019, and so older engines may not support it.[36] To avoid the many pitfalls caused by executing arbitrary code from the Internet, a new function, JSON.parse(), was first added to the fifth edition of ECMAScript,[37] which as of 2017 is supported by all major browsers. For non-supported browsers, an API-compatible JavaScript library is provided by Douglas Crockford.[38] In addition, the TC39 proposal "Subsume JSON" made ECMAScript a strict JSON superset as of the language's 2019 revision.[17][18] Various JSON parser implementations have suffered from denial-of-service attack and mass assignment vulnerability.[39][40]

Alternatives

[edit]

JSON is promoted as a low-overhead alternative to XML as both of these formats have widespread support for creation, reading, and decoding in the real-world situations where they are commonly used.[41] Apart from XML, examples could include CSV and supersets of JSON. Google Protocol Buffers can fill this role, although it is not a data interchange language. CBOR has a superset of the JSON data types, but it is not text-based. Ion is also a superset of JSON, with a wider range of primary types, annotations, comments, and allowing trailing commas.[42]

XML

[edit]

XML has been used to describe structured data and to serialize objects. Various XML-based protocols exist to represent the same kind of data structures as JSON for the same kind of data interchange purposes. Data can be encoded in XML in several ways. The most expansive form using tag pairs results in a much larger (in character count) representation than JSON, but if data is stored in attributes and short tag form where the closing tag is replaced with />, the representation is often about the same size as JSON or just a little larger. However, an XML attribute can only have a single value and each attribute can appear at most once on each element.

XML separates data from metadata (via the use of elements and attributes), while JSON does not have such a concept.

Another key difference is the addressing of values. JSON has objects with a simple key-to-value mapping, whereas in XML addressing happens on nodes, each of which receives a unique ID via the XML processor. Additionally, the XML standard defines a common attribute xml:id, that can be used by the user, to set an ID explicitly.

XML tag names cannot contain any of the characters !"#$%&'()*+,/;<=>?@[\]^`{|}~, nor a space character, and cannot begin with -, ., or a numeric digit, whereas JSON keys can (even if quotation mark and backslash must be escaped).[43]

XML values are strings of characters, with no built-in type safety. XML has the concept of schema, that permits strong typing, user-defined types, predefined tags, and formal structure, allowing for formal validation of an XML stream. JSON has several types built-in and has a similar schema concept in JSON Schema.

XML supports comments, while JSON does not.[44][21]

Supersets

[edit]

Support for comments and other features have been deemed useful, which has led to several nonstandard JSON supersets being created. Among them are HJSON,[45] HOCON, and JSON5 (which despite its name, is not the fifth version of JSON).[46][47]

YAML

[edit]

YAML version 1.2 is a superset of JSON; prior versions were not strictly compatible. For example, escaping a slash / with a backslash \ is valid in JSON, but was not valid in YAML.[48] YAML supports comments, while JSON does not.[48][46][21]

CSON

[edit]

CSON ("CoffeeScript Object Notation") uses significant indentation and unquoted keys, and assumes an outer object declaration. It was used for configuring GitHub's Atom text editor.[49][50][51]

There is also an unrelated project called CSON ("Cursive Script Object Notation") that is more syntactically similar to JSON.[52]

HOCON

[edit]

HOCON ("Human-Optimized Config Object Notation") is a format for human-readable data, and a superset of JSON.[53] The uses of HOCON are:

  • It is used mostly along with the Play Framework,[54] and is developed by Lightbend.
  • It is also supported as a configuration format for .NET projects via Akka.NET[55][56] and Puppet.[57]
  • TIBCO Streaming:[58] HOCON is the primary configuration file format for the TIBCO Streaming[59] family of products (StreamBase, LiveView, and Artifact Management Server) as of TIBCO Streaming Release 10.[60]
  • It is also the primary configuration file format for several subsystems of Exabeam Advanced Analytics.[61]
  • Jitsi uses it as the "new" config system and .properties-Files as fallback[62][63]

JSON5

[edit]

JSON5 ("JSON5 Data Interchange Format") is an extension of JSON syntax that, like JSON, is also valid JavaScript syntax. The specification was started in 2012 and finished in 2018 with version 1.0.0.[64] The main differences to JSON syntax are:

  • Optional trailing commas
  • Unquoted object keys
  • Single quoted and multiline strings
  • Additional number formats
  • Comments

JSON5 syntax is supported in some software as an extension of JSON syntax, for instance in SQLite.[65]

JSONC

[edit]

JSONC (JSON with Comments) is a subset of JSON5 used in Microsoft's Visual Studio Code:[66]

  • supports single-line comments (//) and block comments (/* */)
  • accepts trailing commas, but they are discouraged and the editor will display a warning

Derivatives

[edit]

Several serialization formats have been built on or from the JSON specification. Examples include

  • GeoJSON, a format designed for representing simple geographical features[67][68]

See also

[edit]

Notes

[edit]

References

[edit]
  1. ^ a b c "Douglas Crockford: The JSON Saga". YouTube. August 28, 2011. Retrieved February 21, 2022. Transcript: Transcript Vids at the Wayback Machine (archived 2025-08-05)
  2. ^ a b c "ISO/IEC 21778:2017 Information technology — The JSON data interchange syntax". ISO. Retrieved June 24, 2025.
  3. ^ "ECMA-404: The JSON Data Interchange Syntax" (2nd ed.). Ecma International. December 2017. p. iii, footnote. Archived (PDF) from the original on October 27, 2019. Retrieved April 29, 2024.
  4. ^ a b c "ECMA-404: The JSON Data Interchange Format" (1st ed.). Ecma International. October 2013. Archived (PDF) from the original on November 1, 2013. Retrieved November 20, 2023.
  5. ^ Nemeth, Evi; Snyder, Garth; Hein, Trent R.; Whaley, Ben; Mackin, Dan (2017). "19: Web Hosting". UNIX and Linux System Administration Handbook (5th ed.). Addison-Wesley Professional. ISBN 9780134278292. Retrieved October 29, 2019.
  6. ^ a b Bray, T. (December 2017). Bray, T (ed.). The JavaScript Object Notation (JSON) Data Interchange Format. IETF. doi:10.17487/RFC8259. S2CID 263868313. RFC 8259. Retrieved February 16, 2018.
  7. ^ Bray, Tim. "JSON Redux AKA RFC7159". Ongoing. Retrieved March 16, 2014.
  8. ^ "Unofficial Java History". Edu4Java. 26 May 2014. Archived from the original on 26 May 2014. Retrieved 30 August 2019. In 1996, Macromedia launches Flash technology which occupies the space left by Java and ActiveX, becoming the de facto standard for animation on the client side.
  9. ^ "JSON". json.org.
  10. ^ Yahoo!. "Using JSON with Yahoo! Web services". Archived from the original on October 11, 2007. Retrieved July 3, 2009.
  11. ^ Crockford, Douglas (May 28, 2009). "Introducing JSON". json.org. Retrieved July 3, 2009. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999.
  12. ^ Bray, Tim (December 2017). "History for draft-ietf-jsonbis-rfc7159bis-04". IETF Datatracker. Internet Engineering Task Force. Retrieved October 24, 2019. 2025-08-05 [...] RFC published
  13. ^ Bray, Tim (December 13, 2017). "RFC 8259 - The JavaScript Object Notation (JSON) Data Interchange Format". IETF Datatracker. Internet Engineering Task Force. Retrieved October 24, 2019. Type: RFC - Internet Standard (December 2017; Errata); Obsoletes RFC 7159; Also known as STD 90
  14. ^ "Apache and the JSON license" on LWN.net by Jake Edge (November 30, 2016).
  15. ^ Douglas Crockford (July 10, 2016). "JSON in JavaScript". Archived from the original on July 10, 2016. Retrieved August 13, 2016. JSON is a subset of the object literal notation of JavaScript.
  16. ^ Holm, Magnus (May 15, 2011). "JSON: The JavaScript subset that isn't". The timeless repository. Archived from the original on May 13, 2012. Retrieved September 23, 2016.
  17. ^ a b c "Subsume JSON: Proposal to make all JSON text valid ECMA-262". Ecma TC39. August 23, 2019. Retrieved August 27, 2019.
  18. ^ a b "Advance to Stage 4 - tc39/proposal-json-superset". GitHub. May 22, 2018.
  19. ^ "BigInt - MDN Web doc glossary". Mozilla. Retrieved October 18, 2020.
  20. ^ ECMA-404, 2nd ed., p. 3: "The JSON syntax does not impose any restrictions on the strings used as names, does not require that name strings be unique, and does not assign any significance to the ordering of name/value pairs."
  21. ^ a b c d e Crockford, Douglas (April 30, 2012). "Comments in JSON". Archived from the original on July 4, 2015. Retrieved August 30, 2019. I removed comments from JSON because I saw people were using them to hold parsing directives, a practice which would have destroyed interoperability. I know that the lack of comments makes some people sad, but it shouldn't. Suppose you are using JSON to keep configuration files, which you would like to annotate. Go ahead and insert all the comments you like. Then pipe it through JSMin before handing it to your JSON parser.
  22. ^ Andrysco, Marc; Jhala, Ranjit; Lerner, Sorin (February 18, 2016). Printing Floating-Point Numbers: An Always Correct Method (PDF) (Report). Retrieved May 31, 2025.
  23. ^ "Trailing commas - JavaScript | MDN". developer.mozilla.org. September 12, 2023. Retrieved December 16, 2023.
  24. ^ "JSON5". json5. Archived from the original on November 29, 2020. Retrieved December 16, 2020.
  25. ^ ECMA-404, 2nd ed., p. iii: "The JSON syntax is not a specification of a complete data interchange. Meaningful data interchange requires agreement between a producer and consumer on the semantics attached to a particular use of the JSON syntax. What JSON does provide is the syntactic framework to which such semantics can be attached"
  26. ^ "Media Types". iana.org. Retrieved September 13, 2015.
  27. ^ "Correct Content-Type Header for JSON". ReqBin. January 13, 2023. Retrieved March 23, 2024.
  28. ^ Bray, Tim (December 2017). Bray, T. (ed.). "11. IANA Considerations". RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Format. IETF. doi:10.17487/RFC8259. S2CID 263868313.
  29. ^ "JSON Schema and Hyper-Schema". json-schema.org. Retrieved June 8, 2021.
  30. ^ "JSON Schema - Specification Links". json-schema.org. Retrieved March 22, 2024.
  31. ^ "JSON Schema Implementations". json-schema.org. Archived from the original on June 16, 2021. Retrieved June 8, 2021.
  32. ^ Zyp, Kris (September 16, 2012). Bryan, Paul C. (ed.). "JSON Reference: draft-pbryan-zyp-json-ref-03". Internet Engineering Task Force.
  33. ^ Crockford, Douglas (May 16, 2019). "JSMin". Retrieved August 12, 2020. JSMin [2001] is a minification tool that removes comments and unnecessary whitespace from JavaScript files.
  34. ^ "JSONB data type". www.cockroachlabs.com. Retrieved April 1, 2025.
  35. ^ "The JSON data type". dev.mysql.com. Retrieved April 1, 2025.
  36. ^ "JSON: The JavaScript subset that isn't". Magnus Holm. Archived from the original on May 13, 2012. Retrieved May 16, 2011.
  37. ^ "ECMA-262: ECMAScript Language Specification" (5th ed.). December 2009. Archived (PDF) from the original on April 14, 2011. Retrieved March 18, 2011.
  38. ^ "douglascrockford/JSON-js". GitHub. August 13, 2019.
  39. ^ "Denial of Service and Unsafe Object Creation Vulnerability in JSON (CVE-2013-0269)". Retrieved January 5, 2016.
  40. ^ "Microsoft .NET Framework JSON Content Processing Denial of Service Vulnerability". Archived from the original on November 6, 2018. Retrieved January 5, 2016.
  41. ^ "JSON: The Fat-Free Alternative to XML". json.org. Retrieved March 14, 2011.
  42. ^ "Amazon Ion". Amazon. Archived from the original on August 12, 2024. Retrieved August 26, 2024.
  43. ^ "XML 1.1 Specification". World Wide Web Consortium. Retrieved August 26, 2019.
  44. ^ Saternos, Casimir (2014). Client-server web apps with Javascript and Java. "O'Reilly Media, Inc.". p. 45. ISBN 9781449369316.
  45. ^ Edelman, Jason; Lowe, Scott; Oswalt, Matt. Network Programmability and Automation. O'Reilly Media. for data representation you can pick one of the following: YAML, YAMLEX, JSON, JSON5, HJSON, or even pure Python
  46. ^ a b McCombs, Thayne (July 16, 2018). "Why JSON isn't a good configuration language". Lucid Chart. Retrieved June 15, 2019.
  47. ^ "HOCON (Human-Optimized Config Object Notation)". GitHub. January 28, 2019. Retrieved August 28, 2019. The primary goal is: keep the semantics (tree structure; set of types; encoding/escaping) from JSON, but make it more convenient as a human-editable config file format.
  48. ^ a b "YAML Ain't Markup Language (YAML?) Version 1.2". yaml.org. Retrieved September 13, 2015.
  49. ^ Dohm, Lee (2014). "CoffeeScript Object Notation". The Big Book of Atom. Archived from the original on April 22, 2023. Retrieved April 29, 2024.
  50. ^ "Basic Customization". Atom Flight Manual. GitHub. Archived from the original on April 29, 2024. Retrieved April 29, 2024.
  51. ^ "CSON". Bevry. December 20, 2023. Archived from the original on April 23, 2024. Retrieved April 29, 2024 – via GitHub.
  52. ^ Seonghoon, Kang (July 1, 2021). "CSON". Archived from the original on December 16, 2023. Retrieved February 27, 2023 – via GitHub.
  53. ^ "config/HOCON.md at master · lightbend/config". GitHub. Retrieved August 5, 2021.
  54. ^ "Config File - 2.5.x". www.playframework.com. Retrieved August 5, 2021.
  55. ^ Akka.NET HOCON Docs
  56. ^ "Akka.NET Documentation | Akka.NET Documentation". getakka.net. Retrieved August 5, 2021.
  57. ^ "Managing HOCON configuration files with Puppet". Archived from the original on February 11, 2017. Retrieved March 4, 2023.
  58. ^ "StreamBase Documentation". docs.streambase.com. Retrieved August 5, 2021.
  59. ^ "Configuration Guide". docs.streambase.com. Retrieved August 5, 2021.
  60. ^ "StreamBase New and Noteworthy Archive". docs.streambase.com. Retrieved August 5, 2021.
  61. ^ "Exabeam Advanced Analytics Release Notes". Archived from the original on October 20, 2020. Retrieved March 4, 2023.
  62. ^ JITSI Project. "Config phase 1". GitHub. Retrieved February 16, 2021.
  63. ^ JITSI Project. "reference.conf". GitHub. Retrieved February 16, 2021.
  64. ^ "The JSON5 Data Interchange Format". Retrieved June 25, 2022.
  65. ^ SQLite. "JSON Functions And Operators". Retrieved June 25, 2023.
  66. ^ "JSON with Comments - JSON editing in Visual Studio Code". Visual Studio Code. Microsoft. Retrieved April 29, 2024.
  67. ^ Butler, H.; Daly, M.; Doyle, A.; Gillies, Sean; Schaub, T.; Hagen, Stefan (August 2016). "RFC 7946 - The GeoJSON Format". IETF Datatracker. Retrieved June 17, 2022.
  68. ^ "GeoJSON". geojson.org. Retrieved August 7, 2022.
  69. ^ "JSON-LD 1.1". World Wide Web Consortium. July 16, 2020. Retrieved June 17, 2022.
  70. ^ "JSON-LD - JSON for Linking Data". json-ld.org. Retrieved August 7, 2022.
  71. ^ "JSON-RPC". jsonrpc.org. Retrieved June 17, 2022.
  72. ^ "JsonML (JSON Markup Language)". JsonML.org. Retrieved June 17, 2022.
  73. ^ McKamey, Stephen (June 14, 2022), JsonML, retrieved August 7, 2022
  74. ^ "FasterXML/smile-format-specification: New home for Smile format". GitHub. Retrieved June 17, 2022.
  75. ^ Gupta, Ayush (February 10, 2019). "Understanding Smile — A data format based on JSON". Code with Ayush. Retrieved August 7, 2022.
  76. ^ "Universal Binary JSON Specification – The universally compatible format specification for Binary JSON". ubjson.org. Retrieved June 17, 2022.
  77. ^ "UBJSON - JSON for Modern C++". json.nlohmann.me. Retrieved August 7, 2022.
[edit]
维生素d是什么东西 cop是什么 艺考音乐考什么 睡不着吃什么药最有效 王字旁和什么有关
行长是什么级别 外向孤独症是什么意思 吴优为什么叫大胸姐 止鼾什么方法最有效 肛检是检查什么
增生期子宫内膜是什么意思 下连是什么意思 梦见包被偷了什么预兆 拿什么东西不用手 眼底照相是检查什么
伯伯的老婆叫什么 八九不离十是什么意思 血糖高要注意什么 被口什么感觉 形式是什么意思
高氨血症是什么病hcv9jop4ns8r.cn 家里养什么动物吃蟑螂baiqunet.com 网黄什么意思hcv8jop8ns1r.cn 右眼皮跳有什么预兆hcv9jop6ns6r.cn 拉肚子是什么原因引起的怎么办hcv9jop6ns8r.cn
高烧不退是什么原因inbungee.com 什么不迫hcv9jop2ns2r.cn 房颤什么意思hcv9jop2ns6r.cn 喉咙疼吃什么消炎药hcv8jop4ns6r.cn 血瘀吃什么中成药hcv8jop7ns4r.cn
中学为体西学为用是什么意思hcv9jop1ns0r.cn 西柚是什么意思hcv7jop5ns4r.cn 老年人出虚汗是什么原因引起的hcv9jop5ns0r.cn 副县长是什么级别干部fenrenren.com blub是什么意思hcv8jop9ns4r.cn
腺肌瘤是什么病hcv7jop6ns0r.cn 血脂高吃什么好hcv9jop3ns6r.cn 胎盘位于后壁是什么意思hcv8jop1ns2r.cn 转机是什么意思bfb118.com 5月26日什么星座hcv8jop2ns9r.cn
百度