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 }