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
Validating an entire directory
Pass--dir to validate every .json file in a directory at once:
Errors vs. warnings
Errors — must fix
Errors — must fix
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:
Warnings — recommended
Warnings — recommended
Warnings indicate that a recommended field is absent. The record is still technically valid, but completing these fields improves discoverability and data quality. The recommended fields checked are:
creator, date, subject, location, rights, source, formatYou can safely publish a record with warnings, but consider filling these fields before contributing to a shared archive.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
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
typevalue to one of the permitted enum values - Wrap multi-value fields (
subject) in a JSON array
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
Becausedms 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