AutomationCLI

validate

Validate structured data and return any messages.

The source document is decoded, data is validated against known ontologies, and then processed according to the configured services. Any messages emitted from these steps are collected and returned in the response which relevant scope-specific metadata. By default, a human-readable textual summary is printed where each message starts with a @@@-prefixed line.

When using the --filter flag, a Common Expression Language (CEL) expression evaluates each message and filters to only those which evaluate to true. An "item" variable represents an instance of the Message API type.

For documentation on API types, including the JSON output schema, refer to the documentation at https://schemamarkup.app/api/v1/document.validate.

For access to the captured dataset (in addition to validation messages), refer to the process command.

Usage

schemamarkup validate [flags]
  • bool
  • bool
  • string
  • string
  • string
  • string
  • string
  • string[]
  • bool

Global Flags

  • string

Examples

# Validate structured data of a local HTML file.
schemamarkup validate -i index.html

# Retrieve a web resource (local GET) and validate its structured data.
schemamarkup validate -i https://example.com/index.html

# Pipe a JSON-LD document and output machine-friendly JSON results.
cat document.jsonld | schemamarkup validate --out-type json

# Enable the google-seo-hints service for additional validation.
schemamarkup validate -i index.html --service google-seo-hints

# Suppress messages of a specific kind.
schemamarkup validate -i index.html --filter='item.info.kind != "decoder/public.html-microdata#RecoveredSyntaxContentAttribute"'