Skip to content

Commit

Permalink
Adding ListProperty leniency
Browse files Browse the repository at this point in the history
  • Loading branch information
ryantxu1 committed Apr 1, 2024
1 parent cdd9707 commit 9311c66
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions stix2/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def __init__(self, contained, **kwargs):

super(ListProperty, self).__init__(**kwargs)

def clean(self, value, allow_custom):
def clean(self, value, allow_custom, strict_flag=False):
try:
iter(value)
except TypeError:
Expand All @@ -240,7 +240,7 @@ def clean(self, value, allow_custom):
if isinstance(self.contained, Property):
for item in value:
try:
valid, temp_custom = self.contained.clean(item, allow_custom, strict=True)
valid, temp_custom = self.contained.clean(item, allow_custom, strict=strict_flag)
except TypeError:
valid, temp_custom = self.contained.clean(item, allow_custom)
result.append(valid)
Expand Down Expand Up @@ -451,7 +451,7 @@ def clean(self, value, allow_custom=False):
clean = False
for type_ in self.valid_types:
if isinstance(type_, ListProperty):
type_.clean(value=dictified[k], allow_custom=False)
type_.clean(value=dictified[k], allow_custom=False, strict_flag=True)
clean = True
else:
type_instance = type_()
Expand Down

0 comments on commit 9311c66

Please sign in to comment.