powered by
Validate JSON in file or string
validate_json_file(filename, verbose = FALSE, opts = list(), ...)validate_json_str(str, verbose = FALSE, opts = list(), ...)
validate_json_str(str, verbose = FALSE, opts = list(), ...)
Logical value. TRUE if JSON validates as OK, otherwise FALSE
path to file containing JSON
logical. If the JSON is not valid, should a warning be shown giving details?
Named list of options for parsing. Usually created by opts_read_json()
opts_read_json()
Other named options can be used to override any options in opts. The valid named options are identical to arguments to opts_read_json()
opts
character string containing JSON
tmp <- tempfile() write_json_file(head(iris, 3), tmp) validate_json_file(tmp) str <- write_json_str(iris) validate_json_str(str)
Run the code above in your browser using DataLab