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
It's useful at times to include an already-JSON-encoded object in a new object for JSON-encoding, e.g. to prevent an unneeded decoding step (which can be expensive if performed (m|b|tr)-illions of times):
library(jsonify)
x_json <- read_json_object(from, somewhere) ## ideally we want to not decode x_json
y_json <- list(foo = "bar", x = x_json) |> to_json() ## re-encodes x_json as length-one string array :-|
This is doable with {jsonlite} provided:
x_json has class "json"
toJSON(...) includes the argument json_verbatim = TRUE.
This would be a useful addition to {jsonify} ... and I'm happy to take a stab at it with a PR if you're open to the idea.
The text was updated successfully, but these errors were encountered:
It's useful at times to include an already-JSON-encoded object in a new object for JSON-encoding, e.g. to prevent an unneeded decoding step (which can be expensive if performed (m|b|tr)-illions of times):
This is doable with {jsonlite} provided:
x_json
has class "json"toJSON(...)
includes the argumentjson_verbatim = TRUE
.This would be a useful addition to {jsonify} ... and I'm happy to take a stab at it with a PR if you're open to the idea.
The text was updated successfully, but these errors were encountered: