Module adcp.types.domains.error_details.accessibility_violation

Classes

class AccessibilityViolationDetails (**data: Any)
Expand source code
class AccessibilityViolationDetails(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    violations: Annotated[
        list[Violation],
        Field(
            description='Accessibility requirements the creative or its assets failed. This is distinct from error.issues, which carries JSON Schema validator failures.',
            max_length=4,
            min_length=1,
        ),
    ]
    truncated: Annotated[
        StrictBool | None,
        Field(
            description='True when the producer omitted additional violations or remediation text to keep the complete serialized error within the 4096-byte transport safety limit. Omission means false.'
        ),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var model_config
var truncated : bool | None
var violations : list[Violation]

Inherited members

class FailureKind (*args, **kwds)
Expand source code
class FailureKind(StrEnum):
    alt_text_missing = 'alt_text_missing'
    contrast_ratio_insufficient = 'contrast_ratio_insufficient'
    captions_missing = 'captions_missing'
    transcript_missing = 'transcript_missing'
    keyboard_navigation_failure = 'keyboard_navigation_failure'
    focus_order_invalid = 'focus_order_invalid'
    aria_label_missing = 'aria_label_missing'
    other = 'other'

Enum where members are also (and must be) strings

Ancestors

  • enum.StrEnum
  • builtins.str
  • enum.ReprEnum
  • enum.Enum

Class variables

var alt_text_missing
var aria_label_missing
var captions_missing
var contrast_ratio_insufficient
var focus_order_invalid
var keyboard_navigation_failure
var other
var transcript_missing
class FailureKind1 (value: Any = <object object>, *, root: Any = <object object>)
Expand source code
class FailureKind1(ScalarStr):
    __slots__ = ()
    _constraints = {'max_length': 64, 'pattern': '^x_[a-z0-9]+(?:_[a-z0-9]+)*$'}
    _json_schema_extra = {
        'description': 'Diagnostic failure category. Canonical values cover common portable cases. Vendor-local extensions use an x_ prefix. Portable recovery dispatches on criterion_source plus criterion after validating this details schema; failure_kind may refine diagnostics but does not select the recovery class.',
    }

A str generated from a JSON Schema string root.

Ancestors

  • adcp.types._scalar.ScalarStr
  • adcp.types._scalar._ScalarRoot
  • builtins.str
class Violation (**data: Any)
Expand source code
class Violation(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    pointer: Annotated[
        str,
        Field(
            description='RFC 6901 JSON Pointer rooted at the complete task request payload, not at the nested creative manifest. For example, inline build_creative uses /creative_manifest/assets/hero_image and a sync_creatives batch uses /creatives/0/assets/hero_image. If build_creative resolves a stored manifest from creative_id, use /creative_id because the failing asset is not present in the request.',
            max_length=256,
            pattern='^(?:/(?:[^~/\\u0000-\\u001F\\u007F]|~0|~1)*)*$',
        ),
    ]
    criterion: Annotated[
        str,
        Field(
            description='Stable criterion identifier within criterion_source, for example 1.4.3. Open string so external standards can evolve without an AdCP enum update.',
            max_length=32,
            min_length=1,
            pattern='^[^\\u0000-\\u001F\\u007F]+$',
        ),
    ]
    criterion_source: Annotated[
        str,
        Field(
            description='Standard or policy namespace defining the criterion, for example WCAG21, WCAG22, or EN301549.',
            max_length=64,
            min_length=1,
            pattern='^[A-Za-z][A-Za-z0-9._:-]{0,63}$',
        ),
    ]
    required_level: Annotated[
        str,
        Field(
            description="Conformance level or policy threshold that applied, for example AA. Kept open because not every accessibility standard uses WCAG's A/AA/AAA vocabulary.",
            max_length=64,
            min_length=1,
            pattern='^[^\\u0000-\\u001F\\u007F]+$',
        ),
    ]
    failure_kind: Annotated[
        FailureKind | FailureKind1,
        Field(
            description='Diagnostic failure category. Canonical values cover common portable cases. Vendor-local extensions use an x_ prefix. Portable recovery dispatches on criterion_source plus criterion after validating this details schema; failure_kind may refine diagnostics but does not select the recovery class.'
        ),
    ]
    remediation: Annotated[
        str | None,
        Field(
            description='Optional human-readable correction guidance. Plain text only; consumers treat it as untrusted agent input.',
            max_length=256,
            pattern='^[^\\u0000-\\u001F\\u007F]*$',
        ),
    ] = None

Base model for AdCP types with spec-compliant serialization.

Defaults to extra='ignore' so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.

Important

The env var is resolved once at module import time. Set it in your shell or CI environment before import adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import has no effect on already-imported model classes (they captured the policy at class-body evaluation).

Consumers who want per-model strict validation can override model_config on their subclass.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var criterion : str
var criterion_source : str
var failure_kind : FailureKind | FailureKind1
var model_config
var pointer : str
var remediation : str | None
var required_level : str

Inherited members