LearningLocker / xapi-validation

A package for validating xAPI statements
MIT License
12 stars 15 forks source link

Validation of context activities #324

Open aemion-docebo opened 2 years ago

aemion-docebo commented 2 years ago

Hello,

As per the specification: https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#requirements-11, the values in the contextActivities object (grouping, parent, etc...) can be a single Activity object or an array of Activity objects. From what I've seen, the library is only validating the array case making it non xAPI compliant.

Is it ok to change this behaviour to accept both cases? If yes, I can work on a Pull Request.

andrewlorenz commented 5 months ago

Sorry but the above issue raised is WRONG. The specification clearly states that the contextActivities entries (grouping, parent) must always be an array, even if the array only contains only a single activity. The validator checking for the array case only is correct.