| write_JSONSchema | R Documentation |
Serializes a schema built as a named list and writes it, with the keywords in the registry's reading order. Every generator that publishes to schema.rtemis.org writes through this, so the documents share one shape.
write_JSONSchema(schema, file, overwrite = FALSE, digits = NA, verbosity = 1L)
schema |
Named list: The schema. |
file |
Character: Path to output JSON file. |
overwrite |
Logical: If TRUE, overwrite an existing file. |
digits |
Integer or NA: Significant digits for numeric values, passed to
|
verbosity |
Integer: Verbosity level. |
schema, invisibly.
EDG
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.