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

don't lowercase serialized body entries #2608

Merged
merged 3 commits into from
May 31, 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
8 changes: 8 additions & 0 deletions .chronus/changes/fix_body_root-2024-4-31-12-40-38.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
changeKind: fix
packages:
- "@autorest/python"
- "@azure-tools/typespec-python"
---

don't lowercase serialized names when building a body from splatted arguments
6 changes: 3 additions & 3 deletions packages/autorest.python/autorest/preprocess/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,9 @@ def update_parameter(self, yaml_data: Dict[str, Any]) -> None:
if yaml_data.get("propertyToParameterName"):
# need to create a new one with padded keys and values
yaml_data["propertyToParameterName"] = {
self.pad_reserved_words(prop, PadType.PROPERTY)
.lower(): self.pad_reserved_words(param_name, PadType.PARAMETER)
.lower()
self.pad_reserved_words(prop, PadType.PROPERTY): self.pad_reserved_words(
param_name, PadType.PARAMETER
).lower()
for prop, param_name in yaml_data["propertyToParameterName"].items()
}
wire_name_lower = (yaml_data.get("wireName") or "").lower()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ async def anonymous_model( # pylint: disable=inconsistent-return-statements
if body is _Unset:
if profile_image is _Unset:
raise TypeError("missing required argument: profile_image")
body = {"profileimage": profile_image}
body = {"profileImage": profile_image}
body = {k: v for k, v in body.items() if v is not None}
_body = body.as_dict() if isinstance(body, _model_base.Model) else body
_file_fields: List[str] = ["profileImage"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ def anonymous_model( # pylint: disable=inconsistent-return-statements
if body is _Unset:
if profile_image is _Unset:
raise TypeError("missing required argument: profile_image")
body = {"profileimage": profile_image}
body = {"profileImage": profile_image}
body = {k: v for k, v in body.items() if v is not None}
_body = body.as_dict() if isinstance(body, _model_base.Model) else body
_file_fields: List[str] = ["profileImage"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ async def anonymous_model( # pylint: disable=inconsistent-return-statements
if body is _Unset:
if profile_image is _Unset:
raise TypeError("missing required argument: profile_image")
body = {"profileimage": profile_image}
body = {"profileImage": profile_image}
body = {k: v for k, v in body.items() if v is not None}
_body = body.as_dict() if isinstance(body, _model_base.Model) else body
_file_fields: List[str] = ["profileImage"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ def anonymous_model( # pylint: disable=inconsistent-return-statements
if body is _Unset:
if profile_image is _Unset:
raise TypeError("missing required argument: profile_image")
body = {"profileimage": profile_image}
body = {"profileImage": profile_image}
body = {k: v for k, v in body.items() if v is not None}
_body = body.as_dict() if isinstance(body, _model_base.Model) else body
_file_fields: List[str] = ["profileImage"]
Expand Down
Loading