diff --git a/stix2/base.py b/stix2/base.py
index a6bafff..9fcdf56 100644
--- a/stix2/base.py
+++ b/stix2/base.py
@@ -143,12 +143,12 @@ class _STIXBase(collections.Mapping):
         if custom_props:
             self.__allow_custom = True
 
-        # Remove any keyword arguments whose value is None
+        # Remove any keyword arguments whose value is None or [] (i.e. empty list)
         setting_kwargs = {}
         props = kwargs.copy()
         props.update(custom_props)
         for prop_name, prop_value in props.items():
-            if prop_value is not None:
+            if prop_value is not None and prop_value != []:
                 setting_kwargs[prop_name] = prop_value
 
         # Detect any missing required properties

Ignore empty values for optional fields
Latest version of the library will not allow me to create instances of STIX2 classes with `None` or `[]` values for optional fields.

Example:
```python
In [4]: stix2.Malware(name='test malware', labels=['foo', 'bar'], external_references=[])
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
~/.p/lib/python3.7/site-packages/stix2/base.py in _check_property(self, prop_name, prop, kwargs)
     89             try:
---> 90                 kwargs[prop_name] = prop.clean(kwargs[prop_name])
     91             except ValueError as exc:

~/.p/lib/python3.7/site-packages/stix2/properties.py in clean(self, value)
    164         if len(result) < 1:
--> 165             raise ValueError("must not be empty.")
    166

ValueError: must not be empty.
```

This forces me to write code like this:
```python
external_references = get_external_references()
if external_references:
    obj = stix2.Malware(
        name='test malware',
        labels=['foo', 'bar'],
        external_references=external_references)
else:
    obj = stix2.Malware(
        name='test malware',
        labels=['foo', 'bar'])
```
which is inconvenient.

Proposed solution: the library should accept empty fields for optional fields but should not serialize these in the output JSON, treating these fields as unset
diff --git a/stix2/test/v20/test_malware.py b/stix2/test/v20/test_malware.py
index d0c6d7e..900a4b9 100644
--- a/stix2/test/v20/test_malware.py
+++ b/stix2/test/v20/test_malware.py
@@ -35,6 +35,22 @@ def test_malware_with_all_required_properties():
     assert str(mal) == EXPECTED_MALWARE
 
 
+def test_malware_with_empty_optional_field():
+    now = dt.datetime(2016, 5, 12, 8, 17, 27, tzinfo=pytz.utc)
+
+    mal = stix2.v20.Malware(
+        type="malware",
+        id=MALWARE_ID,
+        created=now,
+        modified=now,
+        labels=["ransomware"],
+        name="Cryptolocker",
+        external_references=[],
+    )
+
+    assert str(mal) == EXPECTED_MALWARE
+
+
 def test_malware_autogenerated_properties(malware):
     assert malware.type == 'malware'
     assert malware.id == 'malware--00000000-0000-4000-8000-000000000001'
diff --git a/stix2/test/v20/test_object_markings.py b/stix2/test/v20/test_object_markings.py
index 495c45a..156c42d 100644
--- a/stix2/test/v20/test_object_markings.py
+++ b/stix2/test/v20/test_object_markings.py
@@ -107,7 +107,6 @@ def test_add_markings_combination():
     "data", [
         ([""]),
         (""),
-        ([]),
         ([MARKING_IDS[0], 456]),
     ],
 )
@@ -576,7 +575,6 @@ def test_set_marking():
 
 @pytest.mark.parametrize(
     "data", [
-        ([]),
         ([""]),
         (""),
         ([MARKING_IDS[4], 687]),
diff --git a/stix2/test/v21/test_object_markings.py b/stix2/test/v21/test_object_markings.py
index d43aad5..7b19d4f 100644
--- a/stix2/test/v21/test_object_markings.py
+++ b/stix2/test/v21/test_object_markings.py
@@ -106,7 +106,6 @@ def test_add_markings_combination():
     "data", [
         ([""]),
         (""),
-        ([]),
         ([MARKING_IDS[0], 456]),
     ],
 )
@@ -575,7 +574,6 @@ def test_set_marking():
 
 @pytest.mark.parametrize(
     "data", [
-        ([]),
         ([""]),
         (""),
         ([MARKING_IDS[4], 687]),

pip install -e .
parse_log_pytest
requirements.txt
pytest pytest-cov
apt-get update apt-get install -y gcc
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
antlr4-python3-runtime==4.9.3
async-generator==1.10
attrs==22.2.0
Babel==2.11.0
backcall==0.2.0
bleach==4.1.0
bump2version==1.0.1
bumpversion==0.6.0
certifi==2021.5.30
cfgv==3.3.1
charset-normalizer==2.0.12
coverage==6.2
decorator==5.1.1
defusedxml==0.7.1
distlib==0.3.9
docutils==0.18.1
entrypoints==0.4
filelock==3.4.1
identify==2.4.4
idna==3.10
imagesize==1.4.1
importlib-metadata==4.8.3
importlib-resources==5.2.3
iniconfig==1.1.1
ipython==7.16.3
ipython-genutils==0.2.0
jedi==0.17.2
Jinja2==3.0.3
jsonschema==3.2.0
jupyter-client==7.1.2
jupyter-core==4.9.2
jupyterlab-pygments==0.1.2
MarkupSafe==2.0.1
mistune==0.8.4
nbclient==0.5.9
nbconvert==6.0.7
nbformat==5.1.3
nbsphinx==0.3.2
nest-asyncio==1.6.0
nodeenv==1.6.0
packaging==21.3
pandocfilters==1.5.1
parso==0.7.1
pexpect==4.9.0
pickleshare==0.7.5
platformdirs==2.4.0
pluggy==1.0.0
pre-commit==2.17.0
prompt-toolkit==3.0.36
ptyprocess==0.7.0
py==1.11.0
Pygments==2.14.0
pyparsing==3.1.4
pyrsistent==0.18.0
pytest==7.0.1
pytest-cov==4.0.0
python-dateutil==2.9.0.post0
pytz==2025.2
PyYAML==6.0.1
pyzmq==25.1.2
requests==2.27.1
simplejson==3.20.1
six==1.17.0
snowballstemmer==2.2.0
Sphinx==1.5.6
sphinx-prompt==1.5.0
-e git+https://github.com/oasis-open/cti-python-stix2.git@f8d4669f800291fd5977efaf924c9bb97b12052f#egg=stix2
stix2-patterns==2.0.0
testpath==0.6.0
toml==0.10.2
tomli==1.2.3
tornado==6.1
tox==3.28.0
traitlets==4.3.3
typing_extensions==4.1.1
urllib3==1.26.20
virtualenv==20.16.2
wcwidth==0.2.13
webencodings==0.5.1
zipp==3.6.0

name: cti-python-stix2
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - antlr4-python3-runtime==4.9.3
      - async-generator==1.10
      - attrs==22.2.0
      - babel==2.11.0
      - backcall==0.2.0
      - bleach==4.1.0
      - bump2version==1.0.1
      - bumpversion==0.6.0
      - cfgv==3.3.1
      - charset-normalizer==2.0.12
      - coverage==6.2
      - decorator==5.1.1
      - defusedxml==0.7.1
      - distlib==0.3.9
      - docutils==0.18.1
      - entrypoints==0.4
      - filelock==3.4.1
      - identify==2.4.4
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.8.3
      - importlib-resources==5.2.3
      - iniconfig==1.1.1
      - ipython==7.16.3
      - ipython-genutils==0.2.0
      - jedi==0.17.2
      - jinja2==3.0.3
      - jsonschema==3.2.0
      - jupyter-client==7.1.2
      - jupyter-core==4.9.2
      - jupyterlab-pygments==0.1.2
      - markupsafe==2.0.1
      - mistune==0.8.4
      - nbclient==0.5.9
      - nbconvert==6.0.7
      - nbformat==5.1.3
      - nbsphinx==0.3.2
      - nest-asyncio==1.6.0
      - nodeenv==1.6.0
      - packaging==21.3
      - pandocfilters==1.5.1
      - parso==0.7.1
      - pexpect==4.9.0
      - pickleshare==0.7.5
      - platformdirs==2.4.0
      - pluggy==1.0.0
      - pre-commit==2.17.0
      - prompt-toolkit==3.0.36
      - ptyprocess==0.7.0
      - py==1.11.0
      - pygments==2.14.0
      - pyparsing==3.1.4
      - pyrsistent==0.18.0
      - pytest==7.0.1
      - pytest-cov==4.0.0
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - pyyaml==6.0.1
      - pyzmq==25.1.2
      - requests==2.27.1
      - simplejson==3.20.1
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==1.5.6
      - sphinx-prompt==1.5.0
      - stix2-patterns==2.0.0
      - testpath==0.6.0
      - toml==0.10.2
      - tomli==1.2.3
      - tornado==6.1
      - tox==3.28.0
      - traitlets==4.3.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - virtualenv==20.16.2
      - wcwidth==0.2.13
      - webencodings==0.5.1
      - zipp==3.6.0
prefix: /opt/conda/envs/cti-python-stix2

stix2/test/v20/test_malware.py::test_malware_with_empty_optional_field
stix2/test/v20/test_malware.py::test_malware_with_all_required_properties stix2/test/v20/test_malware.py::test_malware_autogenerated_properties stix2/test/v20/test_malware.py::test_malware_type_must_be_malware stix2/test/v20/test_malware.py::test_malware_id_must_start_with_malware stix2/test/v20/test_malware.py::test_malware_required_properties stix2/test/v20/test_malware.py::test_malware_required_property_name stix2/test/v20/test_malware.py::test_cannot_assign_to_malware_attributes stix2/test/v20/test_malware.py::test_invalid_kwarg_to_malware stix2/test/v20/test_malware.py::test_parse_malware[{\n stix2/test/v20/test_malware.py::test_parse_malware[data1] stix2/test/v20/test_malware.py::test_parse_malware_invalid_labels stix2/test/v20/test_malware.py::test_parse_malware_kill_chain_phases stix2/test/v20/test_malware.py::test_parse_malware_clean_kill_chain_phases stix2/test/v20/test_object_markings.py::test_add_markings_one_marking[data0] stix2/test/v20/test_object_markings.py::test_add_markings_one_marking[data1] stix2/test/v20/test_object_markings.py::test_add_markings_one_marking[data2] stix2/test/v20/test_object_markings.py::test_add_markings_multiple_marking stix2/test/v20/test_object_markings.py::test_add_markings_combination stix2/test/v20/test_object_markings.py::test_add_markings_bad_markings[data0] stix2/test/v20/test_object_markings.py::test_add_markings_bad_markings[] stix2/test/v20/test_object_markings.py::test_add_markings_bad_markings[data2] stix2/test/v20/test_object_markings.py::test_get_markings_object_marking[data0] stix2/test/v20/test_object_markings.py::test_get_markings_object_and_granular_combinations[data0] stix2/test/v20/test_object_markings.py::test_remove_markings_object_level[data0] stix2/test/v20/test_object_markings.py::test_remove_markings_object_level[data1] stix2/test/v20/test_object_markings.py::test_remove_markings_multiple[data0] stix2/test/v20/test_object_markings.py::test_remove_markings_multiple[data1] stix2/test/v20/test_object_markings.py::test_remove_markings_multiple[data2] stix2/test/v20/test_object_markings.py::test_remove_markings_bad_markings stix2/test/v20/test_object_markings.py::test_clear_markings[data0] stix2/test/v20/test_object_markings.py::test_clear_markings[data1] stix2/test/v20/test_object_markings.py::test_is_marked_object_and_granular_combinations stix2/test/v20/test_object_markings.py::test_is_marked_no_markings[data0] stix2/test/v20/test_object_markings.py::test_is_marked_no_markings[data1] stix2/test/v20/test_object_markings.py::test_set_marking stix2/test/v20/test_object_markings.py::test_set_marking_bad_input[data0] stix2/test/v20/test_object_markings.py::test_set_marking_bad_input[] stix2/test/v20/test_object_markings.py::test_set_marking_bad_input[data2] stix2/test/v21/test_object_markings.py::test_add_markings_one_marking[data0] stix2/test/v21/test_object_markings.py::test_add_markings_one_marking[data1] stix2/test/v21/test_object_markings.py::test_add_markings_one_marking[data2] stix2/test/v21/test_object_markings.py::test_add_markings_multiple_marking stix2/test/v21/test_object_markings.py::test_add_markings_combination stix2/test/v21/test_object_markings.py::test_add_markings_bad_markings[data0] stix2/test/v21/test_object_markings.py::test_add_markings_bad_markings[] stix2/test/v21/test_object_markings.py::test_add_markings_bad_markings[data2] stix2/test/v21/test_object_markings.py::test_get_markings_object_marking[data0] stix2/test/v21/test_object_markings.py::test_get_markings_object_and_granular_combinations[data0] stix2/test/v21/test_object_markings.py::test_remove_markings_object_level[data0] stix2/test/v21/test_object_markings.py::test_remove_markings_object_level[data1] stix2/test/v21/test_object_markings.py::test_remove_markings_multiple[data0] stix2/test/v21/test_object_markings.py::test_remove_markings_multiple[data1] stix2/test/v21/test_object_markings.py::test_remove_markings_multiple[data2] stix2/test/v21/test_object_markings.py::test_remove_markings_bad_markings stix2/test/v21/test_object_markings.py::test_clear_markings[data0] stix2/test/v21/test_object_markings.py::test_clear_markings[data1] stix2/test/v21/test_object_markings.py::test_is_marked_object_and_granular_combinations stix2/test/v21/test_object_markings.py::test_is_marked_no_markings[data0] stix2/test/v21/test_object_markings.py::test_is_marked_no_markings[data1] stix2/test/v21/test_object_markings.py::test_set_marking stix2/test/v21/test_object_markings.py::test_set_marking_bad_input[data0] stix2/test/v21/test_object_markings.py::test_set_marking_bad_input[] stix2/test/v21/test_object_markings.py::test_set_marking_bad_input[data2]
stix2/base.py
stix2/base.py