schema_where_path() matches logical schema paths. schema_where_check()
matches check nodes by kind.
Arguments
- pattern
Pattern passed to
grepl()for matching schema paths.- fixed
Whether
patternshould be matched literally.- kind
Optional check kind to match, such as
"list"or"int".
Details
schema_where_check() matches check nodes present in the schema tree being
walked. It does not resolve $ref targets while querying an authoring
SchemaDoc; use schema_flatten() first if a query should see referenced
definitions through the flattened schema.
Examples
by_path <- schema_where_path("(^|\\$)`date-parts`\\$rest$")
by_int <- schema_where_check("int")
schema <- schema_infer(list(id = 1L))
schema
#> {
#> "check": {
#> "kind": "list"
#> },
#> "fields": {
#> "id": {
#> "check": {
#> "kind": "int"
#> }
#> }
#> }
#> }
schema_find(schema, by_int)
#> [1] "$id"