CZ-NIC / yangson

GNU Lesser General Public License v3.0
53 stars 20 forks source link

The new "expand_keys=True" logic doesn't account for opstate lists that don't have keys #90

Closed kwatsen closed 3 years ago

kwatsen commented 3 years ago

Here's an example: (Note: error=/ should be something like error[0]/)

self = <yangson.schemanode.LeafNode object at 0x1140f5400>, inst = <yangson.instance.ObjectMember object at 0x114141610>, scope = <ValidationScope.all: 3>
ctype = <ContentType.all: 3>                                                      

    def _validate(self: "TerminalNode", inst: InstanceNode, scope: ValidationScope,
                  ctype: ContentType) -> None:
        """Extend the superclass method."""
        if (scope.value & ValidationScope.syntax.value and
                inst.value not in self.type):                                     
>           raise YangTypeError(inst.json_pointer(expand_keys=True), self.type.error_tag,
                                self.type.error_message)
E           yangson.exceptions.YangTypeError: [/ietf-restconf:errors/error=/error-type] invalid-type: expected enumeration

.tox/py38/lib/python3.8/site-packages/yangson/schemanode.py:955: YangTypeError    
kwatsen commented 3 years ago

second Issue opened by error!

GitHub interface fail, not user error ;)