From e626f5c0fac9e28513efa4211a71db8ae4200957 Mon Sep 17 00:00:00 2001 From: iscai-msft <43154838+iscai-msft@users.noreply.github.com> Date: Wed, 5 Jun 2024 17:20:59 -0400 Subject: [PATCH] fix casing of legacy multipart model properties (#2615) --- .chronus/changes/storage_casing-2024-5-5-15-48-15.md | 7 +++++++ .../autorest.python/autorest/m4reformatter/__init__.py | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .chronus/changes/storage_casing-2024-5-5-15-48-15.md diff --git a/.chronus/changes/storage_casing-2024-5-5-15-48-15.md b/.chronus/changes/storage_casing-2024-5-5-15-48-15.md new file mode 100644 index 0000000000..1a5344ae2e --- /dev/null +++ b/.chronus/changes/storage_casing-2024-5-5-15-48-15.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "@autorest/python" +--- + +fix casing of multipart legacy properties \ No newline at end of file diff --git a/packages/autorest.python/autorest/m4reformatter/__init__.py b/packages/autorest.python/autorest/m4reformatter/__init__.py index ab4cfa8fd8..9ae4a5cd4d 100644 --- a/packages/autorest.python/autorest/m4reformatter/__init__.py +++ b/packages/autorest.python/autorest/m4reformatter/__init__.py @@ -700,7 +700,7 @@ def update_flattened_parameter( # this means i'm a property that is part of a flattened model target_property_name = yaml_data["targetProperty"]["language"]["default"]["name"] param = self.update_parameter(yaml_data) - body_parameter.setdefault("propertyToParameterName", {})[target_property_name] = param["clientName"] + body_parameter.setdefault("propertyToParameterName", {})[target_property_name.lower()] = param["clientName"] param["inFlattenedBody"] = True return param @@ -829,7 +829,7 @@ def update_parameters( prop for prop in grouper["type"]["properties"] if p["clientName"].lstrip("_") in prop["groupedParameterNames"] # TODO: patching m4 - )["clientName"]: p["clientName"] + )["clientName"].lower(): p["clientName"] for p in all_params if p.get("groupedBy") == grouper_name }