Skip to main content

Synopsis

Description

dms validate checks DMS JSON records against the official schema using the JSON Schema Draft 2020-12 validator. It reports:
  • Errors — schema violations that make the record invalid (missing required fields, wrong types, disallowed enum values, etc.).
  • Warnings — recommended fields that are absent (creator, date, subject, location, rights, source, format). Warnings do not affect the exit code.
Pass a single FILE to validate one record, or use --dir to validate every .json file found in a directory.

Options

FILE
path
Path to a single .json file to validate. Optional when --dir is used.
--dir
path
Directory containing .json files. All files are validated and a batch summary is printed at the end.

Exit codes

The non-zero exit code on failure makes dms validate safe to use in CI pipelines. Any invalid record will fail the pipeline step.

Terminal output

Valid record:
Invalid record:
Batch summary (directory mode):

Examples

Notes

Add dms validate --dir records/ as a pre-commit hook or CI step to catch schema violations before they are merged.
dms validate only checks .json files. Files with other extensions in the directory are silently skipped.