added file item validation for list strict item

This commit is contained in:
iLLiCiTiT 2021-02-16 16:10:47 +01:00
parent 68ff323978
commit 95d158d557
2 changed files with 10 additions and 1 deletions

View file

@ -101,7 +101,7 @@ class InputEntity(EndpointEntity):
"{}: Missing parent file entity.".format(self.path)
)
super(EndpointEntity, self).schema_validations()
super(InputEntity, self).schema_validations()
@property
def value(self):

View file

@ -206,6 +206,15 @@ class ListStrictEntity(ItemEntity):
if not self.group_item and not self.is_group:
self.is_group = True
def schema_validations(self):
# List entity must have file parent.
if not self.file_item and not self.is_file:
raise ValueError(
"{}: Missing file entity in hierarchy.".format(self.path)
)
super(ListStrictEntity, self).schema_validations()
def get_child_path(self, child_obj):
result_idx = None
for idx, _child_obj in enumerate(self.children):