diff --git a/stix2/properties.py b/stix2/properties.py index 9c3af1d..340a4ba 100644 --- a/stix2/properties.py +++ b/stix2/properties.py @@ -477,7 +477,7 @@ class ReferenceProperty(Property): if self.valid_types: ref_valid_types = enumerate_types(self.valid_types, 'v' + self.spec_version.replace(".", "")) - if possible_prefix in ref_valid_types: + if possible_prefix in ref_valid_types or self.allow_custom: required_prefix = possible_prefix + '--' else: raise ValueError("The type-specifying prefix '%s' for this property is not valid" % (possible_prefix)) diff --git a/stix2/v20/sdo.py b/stix2/v20/sdo.py index 6769873..b190449 100644 --- a/stix2/v20/sdo.py +++ b/stix2/v20/sdo.py @@ -250,6 +250,7 @@ class Report(STIXDomainObject): ]) def __init__(self, *args, **kwargs): + self._properties['object_refs'].contained.allow_custom = kwargs.get('allow_custom', False) self._properties['object_refs'].contained.interoperability = kwargs.get('interoperability', False) super(Report, self).__init__(*args, **kwargs)