DEV Community

IPTV Harmony Editorial
IPTV Harmony Editorial

Posted on

Validate a Streaming-Guide Test Record with JSON Schema

A device guide becomes easier to review when each test record declares the same minimum facts: device, software version, country or market, date, source type, and outcome. JSON Schema can validate that structure before an editorial record is saved.

This example validates structure, not truth. A record can match the schema and still contain an incorrect observation, so editorial review and source checking remain necessary.

Example record

{
  "device": "Example streaming box",
  "softwareVersion": "1.2.3",
  "market": "DE",
  "checkedOn": "2026-09-22",
  "sourceType": "manufacturer-support",
  "outcome": "passed",
  "notes": "Menu path was present on the test device."
}
Enter fullscreen mode Exit fullscreen mode

Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "device",
    "softwareVersion",
    "market",
    "checkedOn",
    "sourceType",
    "outcome"
  ],
  "properties": {
    "device": { "type": "string", "minLength": 2, "maxLength": 100 },
    "softwareVersion": { "type": "string", "minLength": 1, "maxLength": 40 },
    "market": { "type": "string", "pattern": "^[A-Z]{2}$" },
    "checkedOn": { "type": "string", "format": "date" },
    "sourceType": {
      "enum": ["manufacturer-support", "publisher-docs", "direct-test"]
    },
    "outcome": { "enum": ["passed", "failed", "inconclusive"] },
    "notes": { "type": "string", "maxLength": 500 }
  }
}
Enter fullscreen mode Exit fullscreen mode

Why these fields matter

The model and version limit overgeneralization. The market records regional scope. The date makes staleness visible. The source type separates a manufacturer's instruction from a direct observation. The outcome allows an inconclusive test instead of forcing a pass or fail.

The setting additionalProperties: false is useful here because a misspelled field should not silently enter the record. In a larger system you may prefer a more flexible policy, but the decision should be explicit.

What should stay out

Do not put account passwords, payment data, tokens, private playlist addresses, or personal contact details into an editorial test record. Use anonymized labels when a device or account name could identify a person.

Start2Watch uses source and scope checks as part of its public device-guide workflow.

References

Top comments (0)