Open JosiahParry opened 3 months ago
Thanks for raising this issue. There's a few things around NULL/empty handling that are on my list - I'll add this to it.
[]-array
is emptyInopts_read_json()
empty_array = ...
list()
, but common alternatives would be NULL
, ""
(empty string), NA
Empty json []-array
handling is here: https://github.com/coolbutuseless/yyjsonr/blob/07655b5183802ad27746cf35041f023561984aff/src/R-yyjson-parse.c#L1135
{}-objects
{}-objects
?{}-objects
produce an empty named list()
in R{}-object
handling could go about here: https://github.com/coolbutuseless/yyjsonr/blob/07655b5183802ad27746cf35041f023561984aff/src/R-yyjson-parse.c#L1633
The
details
in the following JSON is parsed into alist()
by yyjsonr{"error":{"code":400,"message":"Invalid URL","details":[]}}
I know that
details
will only every be a character vector. Thelist()
is causing an issue with existing code that expects either a NULL or a character vector. Is there an option that can be set to change the behavior of yyjsonr in this case?