Write a schema list produced by S7_to_JSONSchema to a JSON file
Source:R/010_Props.R
write_JSONSchema.RdWrite a schema list produced by S7_to_JSONSchema to a JSON file
Arguments
- schema
Named list: Schema produced by S7_to_JSONSchema.
- file
Character: Path to output JSON file.
- overwrite
Logical: If TRUE, overwrite an existing file.
- verbosity
Integer: Verbosity level.
Examples
schema <- list(
`$schema` = "https://json-schema.org/draft/2020-12/schema",
`$id` = "https://example.org/demo/v1/schema.json",
title = "Demo",
type = "object",
properties = list(n = list(type = "integer", minimum = 1L))
)
tmpfile <- file.path(tempdir(), "demo.schema.json")
write_JSONSchema(schema, tmpfile, overwrite = TRUE, verbosity = 0L)