Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix casing of legacy multipart model properties #2615

Merged
merged 2 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading