Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group with empty member list violates spec? #105

Open
dcollien opened this issue Mar 21, 2021 · 0 comments
Open

Group with empty member list violates spec? #105

dcollien opened this issue Mar 21, 2021 · 0 comments

Comments

@dcollien
Copy link

dcollien commented Mar 21, 2021

I've noticed LRS.io (Veracity LRS) does not accept statements from this library which has an "empty list" for the member field of a Group (as is the default in this implementation), it only allows member lists with one or more element, or with the member field missing.

I've patched my own version of group.py to accept None as the default for member rather than empty list (which ends up being omitted) to work around this, but perhaps this could be the default on this implementation too.

    def __init__(self, *args, **kwargs):
        self._object_type = None
        self._member = None

        super(Group, self).__init__(*args, **kwargs)

    def addmember(self, value):
        if self._member is None:
            self._member = AgentList()
        # ... etc.

    @member.setter
    def member(self, value):
        if value is None:
            self._member = None
        else:
           # ... etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant