SCHEMA <- system.file("json", "manifest_schema.json", package = "fastgenomicsR")
#' Checks the manifest against the schema
validate_manifest <-
function(manifest_path) {
v <- jsonvalidate::json_validator(SCHEMA)
validation <- v(manifest_path, verbose = TRUE, greedy = TRUE)
if (!validation) {
errors <- attr(validation, "errors")
validation_errors <- paste(Map(function(x, y) {
paste(x, y, sep = " ")
}, errors$field, errors$message),
collapse = "\n")
stop(
stringr::str_interp(
"${manifest_path} failed validation with the following errors:\n${validation_errors}"
)
)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.