Creates a JSON Schema property definition for a string value.
Usage
schema_string(
description = NULL,
default = NULL,
min_length = NULL,
max_length = NULL,
pattern = NULL
)Examples
# Simple string
schema_string(description = "Model name", default = "my_model")
#> $type
#> [1] "string"
#>
#> $description
#> [1] "Model name"
#>
#> $default
#> [1] "my_model"
#>
# String with pattern constraint
schema_string(
description = "Date format",
pattern = "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
)
#> $type
#> [1] "string"
#>
#> $description
#> [1] "Date format"
#>
#> $pattern
#> [1] "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
#>