diff --git a/stix2/custom.py b/stix2/custom.py index 81991e9..0db9d25 100644 --- a/stix2/custom.py +++ b/stix2/custom.py @@ -53,7 +53,7 @@ def _custom_marking_builder(cls, type, properties, version): return _CustomMarking -def _custom_observable_builder(cls, type, properties, version, id_contrib_props=[]): +def _custom_observable_builder(cls, type, properties, version, id_contrib_props=None): class _CustomObservable(cls, _Observable): if not re.match(TYPE_REGEX, type): diff --git a/stix2/v21/observables.py b/stix2/v21/observables.py index 5c23362..88d2f6c 100644 --- a/stix2/v21/observables.py +++ b/stix2/v21/observables.py @@ -966,7 +966,7 @@ class X509Certificate(_Observable): self._check_at_least_one_property(att_list) -def CustomObservable(type='x-custom-observable', properties=None, id_contrib_props=[]): +def CustomObservable(type='x-custom-observable', properties=None, id_contrib_props=None): """Custom STIX Cyber Observable Object type decorator. Example: @@ -980,6 +980,9 @@ def CustomObservable(type='x-custom-observable', properties=None, id_contrib_pro ... pass """ + if id_contrib_props is None: + id_contrib_props = [] + def wrapper(cls): _properties = list(itertools.chain.from_iterable([ [('type', TypeProperty(type))],