qecx.DecoderConfigValidator

class qecx.DecoderConfigValidator

Bases: ABC

Base for decoder-specific validation of one decoder’s config body.

A concrete validator knows what a single reserved decoder slug requires of its config body (which tags must be present and what type their values carry) and reports those decoder-specific findings. The findings use the generic rule ids DECODER_REQUIRED_TAG and DECODER_TAG_TYPE owned here, with the decoder named in the path and message, so the rule-id set does not grow as decoders are added.

Variables:
  • decoder_identifier (str) – The reserved decoder slug this validator checks.

  • display_name (str) – Human-friendly decoder name for display.

abstractmethod validate(body, data, *, json_path)

Validate one decoder’s config body against its requirements.

Parameters:
  • body (dict) – The decoder’s config body with parametric references already resolved.

  • data (dict) – The full parsed document, available for cross-section checks.

  • json_path (str) – JSON-path prefix for the decoder’s body, used to build the path of any emitted finding.

Returns:

The decoder-specific findings, using rule ids DECODER_REQUIRED_TAG and DECODER_TAG_TYPE; empty when the body satisfies the decoder’s requirements.

Return type:

list[ValidationError]

classmethod for_slug(slug)

Return the validator class registered for a decoder slug.

Parameters:

slug (str) – The decoder slug to look up.

Returns:

The registered validator class, or None when slug is not in the reserved set.

Return type:

type[DecoderConfigValidator] | None