validate
Validate a structured data document and report messages with source locations.
Validates a structured data document (such as JSON-LD, RDFa, or Microdata) by submitting it to the configured schemamarkup API and reporting any validation messages found.
Each message includes a severity, kind, and optional description along with source offsets that identify the relevant location in the input document. The default text output renders annotated source excerpts showing the exact lines and columns relevant to each message.
Input is read using a configurable reader that supports common structured data formats including JSON-LD, RDFa, and Microdata. When no --in file is specified, input is read from stdin.
Output formats: text Human-readable report with annotated source excerpts (default). json Machine-readable JSON of the full validation response.
Additional validation services, such as search engine-specific validators, can be applied with the --service flag.
schemamarkup validate [flags]Examples
# Validate a JSON-LD file and print messages to stdout
schemamarkup validate -i index.html
# Validate a document piped from stdin
cat index.html | schemamarkup validate
# Output validation results as machine-readable JSON
schemamarkup validate -i index.html --out-type json
# Save the validation report to a file
schemamarkup validate -i index.html -o results.txt
# Apply the Google Search validator service in addition to default checks
schemamarkup validate -i index.html --service google-search
# Canonicalize the results for deterministic output
schemamarkup validate -i index.html --canonicalizeFlags
- bool
- bool
- string[]
- string
- string
- string
- string
- string[]
Global Flags
- string