-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
Description
Many web applications use a notation like mymodel[141253][name] where 141253 is the identifier of the described mymodel object.
In the current spec, this will create a JSON array with the key mymodel. In this array, 141252 explicit nullitems will be created, which will be suboptimal both for the size of the JSON message and for the processing time of the recipient.
AFAIK, JSON won't allow to use an array structure with arbitrary keys without explictly creating all keys in the sequence.
One solution would be to always convert mymodel[141253][name] to hash and never to array, generating
{
"mymodel": {
"141253": {
"name": "…"
}
}
}This seems less smart than the current spec, but won't bug on this common use case.