safe_to_json: Safe Serialization to JSON

View source: R/schema.R

safe_to_jsonR Documentation

Safe Serialization to JSON

Description

Standardized internal helper for JSON serialization with common defaults. Object types registered via register_json_coercion() (for example ggplot objects, via aisdk.datatools) are coerced before serialization.

Usage

safe_to_json(x, auto_unbox = TRUE, ...)

Arguments

x

Object to serialize.

auto_unbox

Whether to automatically unbox single-element vectors. Default TRUE.

...

Additional arguments to jsonlite::toJSON.

Value

A JSON string.


aisdk documentation built on May 29, 2026, 9:07 a.m.