Validate a PMO against the JSON Schema
pmo_validate_jsonschema.RdPerforms full JSON Schema validation using jsonvalidate (ajv engine). The PMO is converted to its on-disk (0-based) JSON form before validation.
Usage
pmo_validate_jsonschema(
pmo,
schema = NULL,
version = NULL,
engine = c("ajv", "imjv"),
error = TRUE,
verbose = TRUE
)Arguments
- pmo
A
PortableMicrohaplotypeObject, parsed PMO list, file path, or JSON string.- schema
Optional schema (file path, JSON string, or parsed list). If
NULL, the bundled schema forversionis used.- version
Optional schema version to validate against (defaults to
pmo_schema_version()). Lets you validate a raw PMO against a different schema version than the one the R6 classes were generated from.- engine
jsonvalidate engine,
"ajv"(default) or"imjv".- error
If
TRUE(default), raise an error when validation fails; otherwise return the logical result (with anerrorsattribute).- verbose
Passed to the validator to collect error details.
Examples
p <- read_pmo(
system.file("extdata", "example_full_pmo.json.gz", package = "pmotoolsr"))
pmo_validate_jsonschema(p)