Skip to content

Commit

Permalink
fix casing of legacy multipart model properties (#2615)
Browse files Browse the repository at this point in the history
  • Loading branch information
iscai-msft authored Jun 5, 2024
1 parent fddb389 commit e626f5c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .chronus/changes/storage_casing-2024-5-5-15-48-15.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: fix
packages:
- "@autorest/python"
---

fix casing of multipart legacy properties
4 changes: 2 additions & 2 deletions packages/autorest.python/autorest/m4reformatter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit e626f5c

Please sign in to comment.