Stringified JSON is a string which can be parsed as a JSON. While a standard JSON interpretation of list(number = 9) would be {"number":9}, a stringified JSON representation would be "{\"number\":9}".

This function will convert NULL values to JSON "nulls", to match the convention used by Lambda event inputs, and values are automatically unboxed.

as_stringified_json(x, ...)

Arguments

x

R object to be converted to stringified JSON.

...

additional arguments (except auto_unbox and null) passed to toJSON

Value

character

Examples

as_stringified_json(list(number = 9))
#> [1] "{\"number\":9}"
"{\"number\":9}"
#> [1] "{\"number\":9}"