You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could we add support for explicitly treating a vector as scalar? This is the reverse of auto_unbox = TRUE and opting out with I(); instead everything is vector and we explicitly decorate a length-1 vector as scalar. This also gives us the option of throwing errors when our "scalar" isn't length-1.
Example R to JSON:
Input
list(my_scalar="foo", my_vector="bar")
Output
{"my_scalar":"foo","my_vector":["bar"]}
{jsonlite}'s approach to this is to decorate scalars with a class ("scalar").
Could we add support for explicitly treating a vector as scalar? This is the reverse of
auto_unbox = TRUE
and opting out withI()
; instead everything is vector and we explicitly decorate a length-1 vector as scalar. This also gives us the option of throwing errors when our "scalar" isn't length-1.Example R to JSON:
Input
Output
{jsonlite}'s approach to this is to decorate scalars with a class ("scalar").
The text was updated successfully, but these errors were encountered: