Learn R Programming

schemate (version 0.1.0)

schema_ref: Create a schema reference fragment

Description

schema_ref() creates a local $defs reference fragment. name may be either a bare definition name such as "text" or a local ref string of the form "#/$defs/text".

Usage

schema_ref(name, description = NULL)

Value

A raw schema fragment accepted by schema_doc() and schema edit verbs.

Arguments

name

Definition name or local $defs ref string.

description

Optional node description.

Examples

Run this code
schema <- schema_doc(list(
    `$defs` = list(text = schema_check("string")),
    `$ref` = "#/$defs/text"
))
schema

schema_validate(schema, "ok", mode = "test")
schema_ref("text")

Run the code above in your browser using DataLab