jsonlite
jsonlite copied to clipboard
"auto_unbox = TRUE" does not unbox vector corresponding to one data.frame
toJSON(list(x = 1, y = data.frame(a = 2, b = 3)), pretty = TRUE, auto_unbox = TRUE)
{
"x": 1,
"y": [
{
"a": 2,
"b": 3
}
]
}
Note that unbox does not work even though y is a vector containing 1 object. Desired output is:
{
"x": 1,
"y": {
"a": 2,
"b": 3
}
}