Skip to main content
The dms validate command checks one or more records against the DMS JSON Schema. It distinguishes between errors that must be fixed and warnings for recommended fields that are absent.

Validating a single file

If the record is valid you will see a green panel, followed by any warnings for recommended fields that are missing:
If the record has schema violations you will see a red panel and a table listing every problem:

Validating an entire directory

Pass --dir to validate every .json file in a directory at once:
Each file is reported individually, then a batch summary is printed:

Errors vs. warnings

Errors mean the record does not conform to the DMS schema. The record will be rejected by any tool that enforces the schema. Common causes:

Validation workflow

1

Create or edit your record

Use dms init, the DMS Vault, or a text editor to produce a .json file. See Creating records for details.
2

Run single-file validation

Read every error in the output table — each row names the field and describes the problem precisely.
3

Fix errors

Address each error. The most common fixes:
  • Add missing required fields (id, title, type, description, language)
  • Replace empty string values with real content
  • Correct the type value to one of the permitted enum values
  • Wrap multi-value fields (subject) in a JSON array
Run dms info at any time to see all valid type values, creator roles, and access levels.
4

Re-validate until clean

Re-run dms validate after each round of fixes. Repeat until you see the green ✓ VALID panel.
5

Batch-validate your archive directory

Before publishing or sharing your collection, run a batch validation:
The command exits with code 1 if any file is invalid, making it suitable for CI/CD pipelines.

Using validation in CI/CD

Because dms validate exits with code 0 when all records are valid and 1 when any are invalid, you can integrate it directly into a CI pipeline:
.github/workflows/validate.yml
The pipeline step will fail automatically if a contributor adds an invalid record, preventing malformed metadata from reaching your main branch.
Add dms validate --dir records/ as a pre-commit hook to catch errors before they are ever committed.