Perspective special characters in property names / object keys

I would also appreciate the ability to use arbitrary strings as property keys.

With the expectation that if I have a key that is not supported via the dot accessor syntax, that I’ll need to use square bracket notation or a getter:

# Python
string = `{
  "key": "value",
  "20": "key of numeric string",
  "prop.test": "key with a period"
}`

obj = system.util.jsonDecode(string)

print obj["20"] # key of numeric string
print obj["prop.test"] # key with a period
// JavaScript
const string = `{
  "key": "value",
  "20": "key of numeric string",
  "prop.test": "key with a period"
}`

const obj = JSON.parse(string)

console.log(obj["20"]) // key of numeric string
console.log(obj["prop.test"]) // key with a period

Perspective’s own view.json schema uses keys that contain dots.

Also, this is already kinda supported (if you can find a way to force “invalid” keys into the property tree):

1 Like