Skip to contents

Read a spec_ir object from a YAML or JSON file

Usage

read_spec_ir(path, format = NULL, validate = TRUE, auto_migrate = FALSE)

Arguments

path

Path to a .yaml, .yml, or .json specification file.

format

Optional format ("yaml" or "json"). Inferred from path extension when NULL.

validate

Logical; if TRUE (default), validates the loaded IR.

auto_migrate

Logical; if TRUE, automatically migrates legacy IR versions via migrate_spec_ir(). Defaults to FALSE.

Value

A spec_ir object.

Examples

spec <- new_spec_ir()
tmp <- tempfile(fileext = ".json")
write_spec_ir(spec, tmp)
spec2 <- read_spec_ir(tmp)
unlink(tmp)