Skip to content
This repository was archived by the owner on May 22, 2026. It is now read-only.

Commit 8124ddd

Browse files
AutoPrFromHttpClientPythonAutoPrFromHttpClientPython
authored andcommitted
Regenerate for typespec-python (2026-05-22 00:14:57)
1 parent 0f5f724 commit 8124ddd

376 files changed

Lines changed: 65368 additions & 8560 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/typespec-python/tests/generated/azure/authentication-api-key/authentication/apikey/_utils/model_base.py

Lines changed: 329 additions & 45 deletions
Large diffs are not rendered by default.

packages/typespec-python/tests/generated/azure/authentication-api-key/authentication/apikey/_utils/serialization.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1405,7 +1405,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
14051405
# Otherwise, result are unexpected
14061406
self.additional_properties_detection = True
14071407

1408-
def __call__(self, target_obj, response_data, content_type=None):
1408+
def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements
14091409
"""Call the deserializer to process a REST response.
14101410
14111411
:param str target_obj: Target data type to deserialize to.
@@ -1415,6 +1415,27 @@ def __call__(self, target_obj, response_data, content_type=None):
14151415
:return: Deserialized object.
14161416
:rtype: object
14171417
"""
1418+
# Fast path for header deserialization: response_data is a plain str or None
1419+
# and target_obj is a simple scalar type. This avoids the expensive
1420+
# _unpack_content → _deserialize → _classify_target → deserialize_data chain.
1421+
if response_data is None:
1422+
return None
1423+
if target_obj == "str" and isinstance(response_data, str):
1424+
return response_data
1425+
if isinstance(response_data, str):
1426+
if target_obj == "int":
1427+
return int(response_data)
1428+
if target_obj == "bool":
1429+
if response_data in ("true", "1", "True"):
1430+
return True
1431+
if response_data in ("false", "0", "False"):
1432+
return False
1433+
return bool(response_data)
1434+
if target_obj == "rfc-1123":
1435+
return Deserializer.deserialize_rfc(response_data)
1436+
if target_obj == "bytearray":
1437+
return Deserializer.deserialize_bytearray(response_data)
1438+
14181439
data = self._unpack_content(response_data, content_type)
14191440
return self._deserialize(target_obj, data)
14201441

0 commit comments

Comments
 (0)