schema_doc() parses a schema DSL list into a schemate schema document
object.
Details
Normal users usually create schema documents with schema_infer(),
schema_read(), or the edit helpers. Use schema_doc() when you are
hand-authoring a schema as an R list.
Examples
doc <- schema_doc(list(check = list(kind = "string", min.chars = 1)))
doc
#> {
#> "check": {
#> "kind": "string",
#> "min.chars": 1
#> }
#> }
schema_validate(doc, "ok")
schema_validate(doc, 1L, mode = "check")
#> [1] "x: Must be of type 'string', not 'integer'"