Schema-only xAPI Statement validator using JSON Schema (draft 2020-12).
- Validates structure/types/required fields according to the bundled schema.
- Supports
$dynamicRef/$dynamicAnchorviajsonschema>=4.18+referencing.
pip install xapi-data-model-validator
Usage
from xapi_data_model_validator import validate_statement
stmt = {
"actor": {"mbox": "mailto:test@example.com"},
"verb": {"id": "https://example.com/verbs/did"},
"object": {"id": "https://example.com/activities/1"}
}
validate_statement(stmt) # raises jsonschema.ValidationError if invalid
Supported versions of xAPI
Currently: 2.0.0 (the schema would reject some valid 1.0.3 statements that don't match 2.0.0 rules).