schema_to_json: Convert Schema to JSON

View source: R/schema.R

schema_to_jsonR Documentation

Convert Schema to JSON

Description

Convert a z_schema object to a JSON string suitable for API calls. Handles the R-specific auto_unbox issues properly.

Usage

schema_to_json(schema, pretty = FALSE)

Arguments

schema

A z_schema object created by z_* functions.

pretty

If TRUE, format JSON with indentation.

Value

A JSON string.

Examples

schema <- z_object(
  name = z_string(description = "User name")
)
cat(schema_to_json(schema, pretty = TRUE))

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