diff --git a/msrest/serialization.py b/msrest/serialization.py
index cc03063..61e811f 100644
--- a/msrest/serialization.py
+++ b/msrest/serialization.py
@@ -623,6 +623,8 @@ class Serializer(object):
          in the iterable into a combined string. Default is 'None'.
         :rtype: list, str
         """
+        if isinstance(data, str):
+            raise SerializationError("Refuse str type as a valid iter type.")
         serialized = []
         for d in data:
             try:

Should refuse a string as a valid list of string
Ends up in the portal as ['a','b','c'] if we use `Model('abc')` instead of `Model(['abc'])`. Should fail, accepting a string for a list of string is likely an error and not a feature.

See https://github.com/Azure/azure-sdk-for-python/issues/1376#issuecomment-323409463
diff --git a/tests/test_serialization.py b/tests/test_serialization.py
index 4d6a80a..39f2878 100644
--- a/tests/test_serialization.py
+++ b/tests/test_serialization.py
@@ -736,6 +736,10 @@ class TestRuntimeSerialized(unittest.TestCase):
         b = self.s.serialize_iter([], 'int')
         self.assertEqual(b, [])
 
+    def test_serialize_str_as_iter(self):
+        with self.assertRaises(SerializationError):
+            self.s.serialize_iter("I am a string", 'str')
+
     def test_serialize_json_obj(self):
 
         class ComplexId(Model):

pip install -e .[dev]
parse_log_pytest_v2
requirements.txt
3.6
dev_requirements.txt
pytest -xvs
attrs==22.2.0
certifi==2021.5.30
charset-normalizer==2.0.12
coverage==6.2
httpretty==1.1.4
idna==3.10
importlib-metadata==4.8.3
iniconfig==1.1.1
isodate==0.6.1
-e git+https://github.com/Azure/msrest-for-python.git@36172c1011c1a6b62eb57f7608ef571b71747a1a#egg=msrest
oauthlib==3.2.2
packaging==21.3
pluggy==1.0.0
py==1.11.0
pyparsing==3.1.4
pytest==7.0.1
pytest-cov==4.0.0
requests==2.27.1
requests-oauthlib==2.0.0
six==1.17.0
tomli==1.2.3
typing_extensions==4.1.1
urllib3==1.26.20
zipp==3.6.0

name: msrest-for-python
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:
      - attrs==22.2.0
      - charset-normalizer==2.0.12
      - coverage==6.2
      - httpretty==1.1.4
      - idna==3.10
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - isodate==0.6.1
      - oauthlib==3.2.2
      - packaging==21.3
      - pluggy==1.0.0
      - py==1.11.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pytest-cov==4.0.0
      - requests==2.27.1
      - requests-oauthlib==2.0.0
      - six==1.17.0
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - zipp==3.6.0
prefix: /opt/conda/envs/msrest-for-python

tests/test_serialization.py::TestRuntimeSerialized::test_serialize_str_as_iter tests/test_serialization.py::TestRuntimeSerialized::test_validate tests/test_serialization.py::TestRuntimeSerialized::test_validation_flag tests/test_serialization.py::TestRuntimeDeserialized::test_attr_bool tests/test_serialization.py::TestRuntimeDeserialized::test_attr_int tests/test_serialization.py::TestRuntimeDeserialized::test_attr_list_complex tests/test_serialization.py::TestRuntimeDeserialized::test_attr_list_in_list tests/test_serialization.py::TestRuntimeDeserialized::test_attr_list_simple tests/test_serialization.py::TestRuntimeDeserialized::test_attr_none tests/test_serialization.py::TestRuntimeDeserialized::test_attr_str tests/test_serialization.py::TestRuntimeDeserialized::test_basic_deserialization tests/test_serialization.py::TestRuntimeDeserialized::test_cls_method_deserialization tests/test_serialization.py::TestRuntimeDeserialized::test_deserialize_datetime tests/test_serialization.py::TestRuntimeDeserialized::test_deserialize_object tests/test_serialization.py::TestRuntimeDeserialized::test_deserialize_storage tests/test_serialization.py::TestRuntimeDeserialized::test_invalid_json tests/test_serialization.py::TestRuntimeDeserialized::test_non_obj_deserialization tests/test_serialization.py::TestRuntimeDeserialized::test_obj_with_malformed_map tests/test_serialization.py::TestRuntimeDeserialized::test_obj_with_no_attr tests/test_serialization.py::TestRuntimeDeserialized::test_personalize_deserialization tests/test_serialization.py::TestRuntimeDeserialized::test_polymorphic_deserialization tests/test_serialization.py::TestRuntimeDeserialized::test_polymorphic_deserialization_with_escape tests/test_serialization.py::TestRuntimeDeserialized::test_robust_deserialization tests/test_serialization.py::TestModelInstanceEquality::test_model_instance_equality
tests/test_serialization.py::TestModelDeserialization::test_response tests/test_serialization.py::TestRuntimeSerialized::test_attr_bool tests/test_serialization.py::TestRuntimeSerialized::test_attr_dict_simple tests/test_serialization.py::TestRuntimeSerialized::test_attr_duration tests/test_serialization.py::TestRuntimeSerialized::test_attr_enum tests/test_serialization.py::TestRuntimeSerialized::test_attr_int tests/test_serialization.py::TestRuntimeSerialized::test_attr_list_complex tests/test_serialization.py::TestRuntimeSerialized::test_attr_list_simple tests/test_serialization.py::TestRuntimeSerialized::test_attr_none tests/test_serialization.py::TestRuntimeSerialized::test_attr_sequence tests/test_serialization.py::TestRuntimeSerialized::test_attr_str tests/test_serialization.py::TestRuntimeSerialized::test_empty_list tests/test_serialization.py::TestRuntimeSerialized::test_key_type tests/test_serialization.py::TestRuntimeSerialized::test_model_validate tests/test_serialization.py::TestRuntimeSerialized::test_obj_serialize_none tests/test_serialization.py::TestRuntimeSerialized::test_obj_with_malformed_map tests/test_serialization.py::TestRuntimeSerialized::test_obj_with_mismatched_map tests/test_serialization.py::TestRuntimeSerialized::test_obj_without_attr_map tests/test_serialization.py::TestRuntimeSerialized::test_polymorphic_serialization tests/test_serialization.py::TestRuntimeSerialized::test_serialize_datetime tests/test_serialization.py::TestRuntimeSerialized::test_serialize_direct_model tests/test_serialization.py::TestRuntimeSerialized::test_serialize_empty_iter tests/test_serialization.py::TestRuntimeSerialized::test_serialize_json_obj tests/test_serialization.py::TestRuntimeSerialized::test_serialize_object tests/test_serialization.py::TestRuntimeSerialized::test_serialize_primitive_types
msrest/serialization.py
msrest/serialization.py