I have found JSON and YAML both lacking.
I wish to do something like this (in YAML):
nodes:
node: "name for my node":
- data
- for
- this
- node
(in JSON):
{"nodes":
{"node":"name for my node": {
["data","for","this","node"]
}}
}
But these are both invalid in those data serialization languages.
Does anyone know of a data serialization language where you can use an object as the name for an object, basically? I think it's stupid that you can't do it in YAML, though I could forgive JSON since it is designed to be simple as opposed to being flexible.
Actually, YAML can do that. Try the complex-key syntax (see the bottom of spec section 2.2)
That's a map with a single key, used as a key. If you perhaps were after a list as the key: