Is there a reason to encode options like this:
{
"options":[
{
"name":"opt1",
"value":"val1",
},
{
"name":"opt2",
"value":"val2",
},
{
"name":"opt3",
"value":"val3",
}
]
}
instead of like this:
{
"options":{
"opt1":"val1",
"opt2":"val2",
"opt3":"val3"
}
}
I regularly see this pattern in both JSON and XML, what is the reason for doing things this way? The only advantage I can see is that the first way would allow duplicate option names, which is usually not relevant.