Is it true that punctuation in property keys can cause developer usability issues in languages such as Ruby which uses symbolic hash key and in Javascript, these characters prevent developers from using dot-notation for property access.
相关问题
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Easiest way to get json and parse it using JQuery
- Newtonsoft DeserializeXNode expands internal array
相关文章
- json_encode 没有把数组转为json
- Livy Server: return a dataframe as JSON?
- Unexpected end of JSON input from an ajax call
- How do I do a nested list (array) of schema refere
- iconv() Vs. utf8_encode()
- Convert C# Object to Json Object
- LINQ .Include() properties from sub-types in TPH i
- How to make a custom list deserializer in Gson?
The JSON Specification doesn't explicitly forbid using hyphens or any other characters in the name/value pairs of objects.
Whether it's a great idea is another, but most languages have no trouble dealing with special characters as the key, e.g. JavaScript:
Because
a-b
is not a valid property namex.a-b
would not work as expected, but JavaScript has an alternative syntax for object dereferencing by using[]
notation.Another example, PHP:
Again,
$x->a-b
would not work, so PHP supports dereferencing using->{}
notation.