Closed FunkMonkey closed 1 year ago
@FunkMonkey thank you for using xAPI.js and for raising this issue!
You're right, the usage of a Statement
within a Statement
object should be a SubStatement
and not just a standard Statement
, with the inclusion of the objectType
property. The spec also identifies that it should not contain the id
, stored
, version
or authority
properties or a nested SubStatement
. I will see what I can do to best represent this in the Interfaces.
@FunkMonkey This should now be available in 2.2.1, please reopen the issue if this doesn't work as expected.
Currently StatementObject is a union that includes
Statement
, which does not provideobjectType
. This leads to TS not knowingstatement.object.objectType
, which is necessary for properly determining the correct object type (even if it is just an optional property as inActivity
).As per xAPI specification a
SubStatement
should be used though:A new interface
SubStatement
should be added and used forStatementObject
, e.g.Thanks!