Learn R Programming

aisdk (version 1.1.0)

z_enum: Create Enum Schema

Description

Create a JSON Schema for string enum type.

Usage

z_enum(values, description = NULL, nullable = FALSE, default = NULL)

Value

A list representing JSON Schema for enum.

Arguments

values

Character vector of allowed values.

description

Optional description of the field.

nullable

If TRUE, allows null values.

default

Optional default value.

Examples

Run this code
z_enum(c("celsius", "fahrenheit"), description = "Temperature unit")

Run the code above in your browser using DataLab