Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Data Validation

Direct 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.

When to use this

Use this when enforcing quality in a source of truth.

First 30 seconds

1. Validate SoT data: schemas, required fields, uniqueness, references.

2. On entry and in CI.

3. Report gaps.

4. Block invalid data.

5. Measure quality.

Operational verification

data → validation → accepted/rejected

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
source-of-truth automation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformsource-of-truth automation · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior. · jq
Key commandjq empty <input.json>
Scope / prerequisiteUse this when enforcing quality in a source of truth.
Reference · 1
What next?3 suggested next steps
Catalog command links1
Evidence0
On this pageJump to a specific section
Automation command reference

Primary Commands

Configuration and operational commands for this Topic.

Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verify deterministic validation and downstream plan identity Verify boundary

Run Data Validation twice against the same versioned source and expect the same pass/fail set, ordering-independent record identities and rule versions. Inspect rejected records with their field paths and confirm valid foreign references resolve to the intended canonical objects. Then feed the validated snapshot into a dry-run, plan or render stage and verify that its input revision/hash matches the accepted source. A green schema validator shows the declared constraints only, but it does not show the data is current, the references are semantically correct or the eventual target state is safe.

Step 2 Command read-back and what it shows Verify boundary

Verification for Source of Truth → Data Validation must distinguish state, not merely report that a command ran. With jq empty <input.json>, known-good means the dataset parses, satisfies the intended schema plus identity/reference/freshness invariants for the selected scope, and a deterministic dry render resolves all referenced objects; known-broken/suspicious means parse/schema errors, duplicate identities, broken references, stale authoritative fields or downstream rendering that cannot resolve an apparently valid record. python -m json.tool <file> shows JSON syntax is parseable, but it does not show schema compliance, referential integrity, freshness or business correctness.

Step 3 Separate parse, schema, semantic and freshness failures Narrow the fault

If Data Validation cannot parse the source, stop at encoding or serialization syntax. If parsing succeeds but schema fails, report the exact field path, expected type/constraint and source record without attempting deployment. A schema-valid record that references a nonexistent or duplicate canonical object is a semantic integrity failure; a valid but old snapshot is a freshness/version boundary. When only some records fail, do not silently drop them if downstream completeness matters. Preserve accepted and rejected counts plus stable record keys so the corrected dataset can be compared deterministically.

Step 4 Common mistakes Narrow the fault
  • Data without validation rules.
Step 5 Observation-driven branch and next-check logic Narrow the fault

When Source of Truth → Data Validation fails, reproduce the smallest original case and capture jq empty <input.json> before mutation. Use the observation to choose the next check: if JSON cannot parse, fix serialization first; if parse succeeds but required/type/range rules fail, correct schema-level data; if schema passes but identity/reference/freshness checks fail, resolve semantic ownership before allowing downstream generation.

Key points
  • Enforce required fields, naming and ranges.
  • Prevent duplicates.
  • Block bad data at entry.
Key checks
  • check-jsonschema --schemafile device.schema.json data/*.yml — schema validation
  • NetBox custom validators — entry validation
  • Data quality reports (missing fields) — gaps
ReferenceWhy it matters1 section · depth on demand

Source-of-truth validation protects identity and referential meaning

Source of Truth Data Validation should happen before rendering or deployment and must cover more than JSON/YAML syntax. Schema/type checks show shape, while semantic checks show identifiers are unique, references resolve, required relationships exist, enumerated values are allowed and canonical formats are used for addresses, names or platform fields. Validation should operate on a versioned snapshot so the accepted dataset can be reproduced. A record that passes local field rules can still be invalid if it points to a missing site, device, interface, tenant or policy object.

ReferenceHow it works1 section · depth on demand

How it works

Source of Truth → Data Validation should be reasoned about as a state pipeline, not as one command outcome. The responsible state is schema-constrained source records, identity/uniqueness rules, referential relationships and freshness needed before source-of-truth data is safe to drive automation. Source-of-truth validation separates syntax/schema validation from semantic checks such as unique identifiers, valid references, allowed ranges and cross-object consistency; downstream renderers assume these invariants unless they revalidate them; meanwhile API freshness, concurrent edits, secrets, external authoritative systems and environment-specific policy are independent things to check. This distinction is especially important because valid JSON only shows parseability and can still contain semantically impossible or stale data, while schema-valid objects can conflict with each other.

ReferenceImportant terms & boundaries1 section · depth on demand

Method

Data validation in a source of truth keeps the data that drives automation correct, because every error in it becomes a configuration error on devices.

1. Enforce field-level rules on entry (required fields, formats, choices, custom validators).

2. Run scheduled consistency checks: every interface with an IP has a VLAN, no overlapping prefixes, every active device has a primary IP.

3. Compare with discovered state and flag differences.

4. Report violations to data owners; block automation for objects with errors.

5. Track the error count over time.

# Nautobot/NetBox-style check
for dev in nb.dcim.devices.filter(status="active"):
    if not dev.primary_ip:
        problems.append(f"{dev.name}: no primary IP")

NetBox custom validators and Nautobot's Data Validation app can enforce many rules at save time.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docsource-of-truth automation current

Authoritative/upstream documentation reviewed for bounded claims in Source of Truth > Data Validation. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://netbox.readthedocs.io/en/stable/introduction/ · confidence 94%
Confirmation

Confirm action

Continue?