JSON 语法是否允许重复值?
Does JSON syntax allow duplicate values?
这有效吗JSON?
{
"a" : [
"x",
"x"
]
}
http://www.json.org/ 没有说它被禁止,但确实说:
JSON is built on two structures:
A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.
An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.
An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.
"An ordered list of values" 建议重复因此有效。这个对吗?有什么更明确的吗?是否有任何 JSON 不允许重复值的实现?
(Here's the related question 关于重复键。)
有效JSON。不允许有重复的键,例如:
{
"a": 1,
"a": 2
}
此外,"ordered" 我认为它指的是值具有预定义的、完善的顺序,而不是它们以任何方式排序:)
这有效吗JSON?
{
"a" : [
"x",
"x"
]
}
http://www.json.org/ 没有说它被禁止,但确实说:
JSON is built on two structures:
A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array. An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.
An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.
"An ordered list of values" 建议重复因此有效。这个对吗?有什么更明确的吗?是否有任何 JSON 不允许重复值的实现?
(Here's the related question 关于重复键。)
有效JSON。不允许有重复的键,例如:
{
"a": 1,
"a": 2
}
此外,"ordered" 我认为它指的是值具有预定义的、完善的顺序,而不是它们以任何方式排序:)