Skip to contents

Create an any schema combinator fragment

Usage

schema_any(..., description = NULL)

Arguments

...

Branch schema fragments.

description

Optional node description.

Value

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

Examples

schema <- schema_doc(schema_any(schema_check("int"), schema_check("string")))
schema
#> {
#>   "any": [
#>     {
#>       "check": {
#>         "kind": "int"
#>       }
#>     },
#>     {
#>       "check": {
#>         "kind": "string"
#>       }
#>     }
#>   ]
#> }

schema_validate(schema, "ok", mode = "test")
#> [1] TRUE