% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/schema-validate.R
\name{validate_json}
\alias{validate_json}
\alias{validate_graph_json}
\alias{validate_split_spec_json}
\title{Validate Serialized splitGraph JSON Against the Shipped Schema}
\usage{
validate_graph_json(path)

validate_split_spec_json(path)
}
\arguments{
\item{path}{Path to a serialized \code{dependency_graph} or
\code{split_spec} JSON file.}
}
\value{
A \code{splitgraph_json_report}: a list with \code{valid} (logical),
  \code{issues} (character vector of failures), the detected
  \code{object_type}, and the schema \code{$id}.
}
\description{
Check that a JSON file written by \code{write_dependency_graph()} or
\code{write_split_spec()} conforms to the splitGraph on-disk contract. The
formal JSON Schemas (Draft 2020-12) ship in \code{inst/schema/} and are
referenced from the written JSON via the \code{$schema} key; these functions
apply a dependency-free structural check of the same invariants (required
fields, value types, node/edge-type enumerations, and referential integrity
of edge endpoints) so a handoff file can be validated without a JSON Schema
engine.
}
\examples{
if (requireNamespace("jsonlite", quietly = TRUE)) {
  meta <- data.frame(sample_id = c("S1", "S2"), subject_id = c("P1", "P2"))
  g <- graph_from_metadata(meta)
  tmp <- tempfile(fileext = ".json")
  write_dependency_graph(g, tmp)
  validate_graph_json(tmp)
  unlink(tmp)
}
}
