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.