as_stringified_json: Convert an R object to stringified JSON matching AWS Lambda...

View source: R/utils.R

as_stringified_jsonR Documentation

Convert an R object to stringified JSON matching AWS Lambda conventions

Description

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.

Usage

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))
"{\"number\":9}"

lambdr documentation built on Nov. 25, 2023, 5:08 p.m.