coolbutuseless / yyjsonr

Fast JSON package for R
https://coolbutuseless.github.io/package/yyjsonr/index.html
Other
133 stars 9 forks source link

Option to read empty array to NULL or vector instead of list #52

Open JosiahParry opened 3 months ago

JosiahParry commented 3 months ago

The details in the following JSON is parsed into a list() by yyjsonr {"error":{"code":400,"message":"Invalid URL","details":[]}}

I know that details will only every be a character vector. The list() 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?

coolbutuseless commented 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.

Notes on arbitrary R objects when JSON []-array is empty

Also need to think about json {}-objects