Learn R Programming

aisdk (version 1.1.0)

schema_to_json: 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)

Value

A JSON string.

Arguments

schema

A z_schema object created by z_* functions.

pretty

If TRUE, format JSON with indentation.

Examples

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

Run the code above in your browser using DataLab