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

Commit 1093c40

Browse files
authored
Sync from typespec main (2026-05-12) (902fef6) (#3485)
* Update dependencies * Sync shared files from typespec repo (2026-05-12 03:54:37) * Add changelog * Update dependencies (2026-05-12 03:55:46) * Regenerate for typespec-python (2026-05-12 04:02:15) --------- Co-authored-by: AutoPrFromHttpClientPython <AutoPrFromHttpClientPython>
1 parent b6ed2e9 commit 1093c40

269 files changed

Lines changed: 11268 additions & 45 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.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
changeKind: internal
3+
packages:
4+
- "@autorest/python"
5+
- "@azure-tools/typespec-python"
6+
---
7+
8+
add baseline of generated code before regenerate to contain necessary customized code for some specific test cases
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
changeKind: fix
3+
packages:
4+
- "@autorest/python"
5+
- "@azure-tools/typespec-python"
6+
---
7+
8+
Fix serialization regression where `@clientDefaultValue` defaults on model properties were no longer included in the request body. Defaults are again materialized in the model's data dictionary at construction time so they are sent on the wire, while the attribute-access fallback for unset fields is preserved.

packages/autorest.python/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
"homepage": "https://github.com/Azure/autorest.python/blob/main/README.md",
3131
"dependencies": {
32-
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNjI0NjE0NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.28.3.tgz",
32+
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNjI4MDE2MS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.28.3.tgz",
3333
"@autorest/system-requirements": "~1.0.2",
3434
"fs-extra": "~11.2.0",
3535
"tsx": "^4.21.0"

packages/typespec-python/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@
6565
"@typespec/xml": ">=0.81.0 <1.0.0"
6666
},
6767
"dependencies": {
68-
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNjI0NjE0NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.28.3.tgz",
68+
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNjI4MDE2MS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.28.3.tgz",
6969
"fs-extra": "~11.2.0",
7070
"js-yaml": "~4.1.0",
7171
"semver": "~7.6.2",
7272
"tsx": "^4.21.0"
7373
},
7474
"devDependencies": {
75-
"@azure-tools/azure-http-specs": "0.1.0-alpha.39",
75+
"@azure-tools/azure-http-specs": "0.1.0-alpha.40-dev.12",
7676
"@azure-tools/typespec-autorest": "~0.67.0",
7777
"@azure-tools/typespec-azure-core": "~0.67.0",
7878
"@azure-tools/typespec-azure-resource-manager": "~0.67.0",

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,14 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None:
620620
if v is not None
621621
}
622622
)
623+
# Apply client default values for fields the caller didn't set so that
624+
# defaults are part of `_data` and therefore included during serialization.
625+
for rf in self._attr_to_rest_field.values():
626+
if rf._default is _UNSET:
627+
continue
628+
if rf._rest_name in dict_to_pass:
629+
continue
630+
dict_to_pass[rf._rest_name] = _create_value(rf, rf._default)
623631
super().__init__(dict_to_pass)
624632

625633
def _init_from_xml(self, element: ET.Element) -> dict[str, typing.Any]:

packages/typespec-python/tests/generated/azure/authentication-http-custom/authentication/http/custom/_utils/model_base.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,14 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None:
620620
if v is not None
621621
}
622622
)
623+
# Apply client default values for fields the caller didn't set so that
624+
# defaults are part of `_data` and therefore included during serialization.
625+
for rf in self._attr_to_rest_field.values():
626+
if rf._default is _UNSET:
627+
continue
628+
if rf._rest_name in dict_to_pass:
629+
continue
630+
dict_to_pass[rf._rest_name] = _create_value(rf, rf._default)
623631
super().__init__(dict_to_pass)
624632

625633
def _init_from_xml(self, element: ET.Element) -> dict[str, typing.Any]:

packages/typespec-python/tests/generated/azure/authentication-noauth-union/authentication/noauth/union/_utils/model_base.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,14 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None:
620620
if v is not None
621621
}
622622
)
623+
# Apply client default values for fields the caller didn't set so that
624+
# defaults are part of `_data` and therefore included during serialization.
625+
for rf in self._attr_to_rest_field.values():
626+
if rf._default is _UNSET:
627+
continue
628+
if rf._rest_name in dict_to_pass:
629+
continue
630+
dict_to_pass[rf._rest_name] = _create_value(rf, rf._default)
623631
super().__init__(dict_to_pass)
624632

625633
def _init_from_xml(self, element: ET.Element) -> dict[str, typing.Any]:

packages/typespec-python/tests/generated/azure/authentication-oauth2/authentication/oauth2/_utils/model_base.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,14 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None:
620620
if v is not None
621621
}
622622
)
623+
# Apply client default values for fields the caller didn't set so that
624+
# defaults are part of `_data` and therefore included during serialization.
625+
for rf in self._attr_to_rest_field.values():
626+
if rf._default is _UNSET:
627+
continue
628+
if rf._rest_name in dict_to_pass:
629+
continue
630+
dict_to_pass[rf._rest_name] = _create_value(rf, rf._default)
623631
super().__init__(dict_to_pass)
624632

625633
def _init_from_xml(self, element: ET.Element) -> dict[str, typing.Any]:

packages/typespec-python/tests/generated/azure/authentication-union/authentication/union/_utils/model_base.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,14 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None:
620620
if v is not None
621621
}
622622
)
623+
# Apply client default values for fields the caller didn't set so that
624+
# defaults are part of `_data` and therefore included during serialization.
625+
for rf in self._attr_to_rest_field.values():
626+
if rf._default is _UNSET:
627+
continue
628+
if rf._rest_name in dict_to_pass:
629+
continue
630+
dict_to_pass[rf._rest_name] = _create_value(rf, rf._default)
623631
super().__init__(dict_to_pass)
624632

625633
def _init_from_xml(self, element: ET.Element) -> dict[str, typing.Any]:

packages/typespec-python/tests/generated/azure/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/_utils/model_base.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,14 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None:
620620
if v is not None
621621
}
622622
)
623+
# Apply client default values for fields the caller didn't set so that
624+
# defaults are part of `_data` and therefore included during serialization.
625+
for rf in self._attr_to_rest_field.values():
626+
if rf._default is _UNSET:
627+
continue
628+
if rf._rest_name in dict_to_pass:
629+
continue
630+
dict_to_pass[rf._rest_name] = _create_value(rf, rf._default)
623631
super().__init__(dict_to_pass)
624632

625633
def _init_from_xml(self, element: ET.Element) -> dict[str, typing.Any]:

0 commit comments

Comments
 (0)