Input:
{
"categories": {
"1": {
"name": "Books"
},
"2": {
"name": "Games"
}
}
}
Spec:
[
{
"operation": "shift",
"spec": {
"categories": {
"*": {
"@": "categories"
}
}
}
}
]
Output (array of categories):
{
"categories" : [ {
"name" : "Books"
}, {
"name" : "Games"
} ]
}
Another Input with just one element
{
"categories": {
"1": {
"name": "Books"
}
}
}
Output:
{
"categories" : {
"name" : "Books"
}
}
I expected the output to be a categories array containing just one element. Why does this spec not create an array when there is a single element?