Learn R Programming

schemate (version 0.1.0)

schema_set_rest: Set or replace a container rest schema

Description

Set or replace a container rest schema

Usage

schema_set_rest(x, field, path = "$")

Value

A modified SchemaDoc.

Arguments

x

A SchemaDoc.

field

Schema fragment using the same list syntax accepted by schema_doc(), or a fragment produced by helpers such as schema_check(), to store as the rest schema.

path

Path to the target container node. Use $ for the root node. Bare field segments such as $id implicitly traverse container fields. Use $fields$id to write the explicit field path. Backtick-quote field names that contain path operators, for example $`a$b` .

Examples

Run this code
schema <- schema_doc(list(
    check = list(kind = "list"),
    keys = list(type = "unnamed")
))
schema <- schema_set_rest(schema, schema_check("string"))
schema

schema_validate(schema, list("a", "b"), mode = "test")

Run the code above in your browser using DataLab