powered by
schema_read() reads schema JSON into a SchemaDoc. schema_write() serializes schema objects to schema JSON. Both functions require the suggested package jsonlite.
schema_read()
SchemaDoc
schema_write()
jsonlite
schema_write(x, path, overwrite = FALSE, pretty = TRUE, auto_unbox = TRUE)schema_read(txt)
schema_read(txt)
schema_read() returns a SchemaDoc. schema_write() invisibly returns path.
path
A schema object accepted by as.list(), usually a SchemaDoc.
as.list()
Output file path.
Whether an existing output file may be overwritten.
Whether JSON output should be pretty-printed.
Passed to jsonlite::write_json().
jsonlite::write_json()
JSON text, local file path, or URL accepted by jsonlite::fromJSON().
jsonlite::fromJSON()
schema <- schema_infer(list(id = 1L)) schema path <- tempfile(fileext = ".json") schema_write(schema, path) schema_read(path)
Run the code above in your browser using DataLab