Pcornel
Automation · Source of Truth

Data Validation

Cheat sheet · https://pcornel.dk/topic.php?topic=5859

Back to the Topic

Answer

Data validation in a source of truth enforces rules on entries — required fields, naming conventions, valid ranges, no duplicates — so automation reading it does not act on bad data.

Remember

  • Enforce required fields, naming and ranges.
  • Prevent duplicates.
  • Block bad data at entry.

First checks

  • check-jsonschema --schemafile device.schema.json data/*.yml — schema validation
  • NetBox custom validators — entry validation
  • Data quality reports (missing fields) — gaps

Commands

jq empty <input.json>
Read-only/validation observation for whether the selected JSON document is syntactically parseable.

Verify in this order

data → validation → accepted/rejected

Where it usually breaks

Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5859

Confirmation

Confirm action

Continue?