Validate JSON in file or string
Arguments
- filename
path to file containing JSON
- verbose
logical. If the JSON is not valid, should a warning be shown giving details?
- opts
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 toopts_read_json()- str
character string containing JSON
Examples
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
