Validate JSON in file or string
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()
Other named options can be used to override any options in opts
.
The valid named options are identical to arguments to opts_read_json()
character string containing JSON
Logical value. TRUE if JSON validates as OK, otherwise FALSE
tmp <- tempfile()
write_json_file(head(iris, 3), tmp)
validate_json_file(tmp)
#> [1] TRUE
str <- write_json_str(iris)
validate_json_str(str)
#> [1] TRUE