From 5ecf748f2bd0f68e665c78b61ccaf45454ba9c11 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Tue, 23 Sep 2025 03:38:59 +0000 Subject: [PATCH 1/5] Update dependencies --- packages/autorest.python/package.json | 2 +- packages/typespec-python/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index 1ea570bae3a..ce9c76d6e80 100644 --- a/packages/autorest.python/package.json +++ b/packages/autorest.python/package.json @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/Azure/autorest.python/blob/main/README.md", "dependencies": { - "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTM2NTY3Ni9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.17.0.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTM3MDU0Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.17.0.tgz", "@autorest/system-requirements": "~1.0.2", "fs-extra": "~11.2.0", "tsx": "~4.19.1" diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index 3fe16a6569e..3ec7d008840 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -67,7 +67,7 @@ "js-yaml": "~4.1.0", "semver": "~7.6.2", "tsx": "~4.19.1", - "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTM2NTY3Ni9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.17.0.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTM3MDU0Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.17.0.tgz", "fs-extra": "~11.2.0" }, "devDependencies": { From 55e99def6decebcbfc9c49501d649b997cf88ed2 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Tue, 23 Sep 2025 03:39:58 +0000 Subject: [PATCH 2/5] Update dependencies (2025-09-23 03:39:58) --- pnpm-lock.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8319bf3dc6d..eb777677ae0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,8 +60,8 @@ importers: specifier: ~1.0.2 version: 1.0.2 '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTM2NTY3Ni9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.17.0.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTM2NTY3Ni9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.17.0.tgz(4dpduvpv7hdb6q7z6oc6wbsr4a) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTM3MDU0Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.17.0.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTM3MDU0Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.17.0.tgz(4dpduvpv7hdb6q7z6oc6wbsr4a) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -82,8 +82,8 @@ importers: packages/typespec-python: dependencies: '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTM2NTY3Ni9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.17.0.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTM2NTY3Ni9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.17.0.tgz(4dpduvpv7hdb6q7z6oc6wbsr4a) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTM3MDU0Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.17.0.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTM3MDU0Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.17.0.tgz(4dpduvpv7hdb6q7z6oc6wbsr4a) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -1677,8 +1677,8 @@ packages: peerDependencies: '@typespec/compiler': ^1.4.0 - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTM2NTY3Ni9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.17.0.tgz': - resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTM2NTY3Ni9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.17.0.tgz} + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTM3MDU0Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.17.0.tgz': + resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTM3MDU0Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.17.0.tgz} version: 0.17.0 engines: {node: '>=20.0.0'} peerDependencies: @@ -6460,7 +6460,7 @@ snapshots: dependencies: '@typespec/compiler': 1.4.0(@types/node@24.1.0) - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTM2NTY3Ni9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.17.0.tgz(4dpduvpv7hdb6q7z6oc6wbsr4a)': + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTM3MDU0Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.17.0.tgz(4dpduvpv7hdb6q7z6oc6wbsr4a)': dependencies: '@azure-tools/typespec-autorest': 0.60.0(ezw5aevbqzniqofcqdfpewwsui) '@azure-tools/typespec-azure-core': 0.60.0(@typespec/compiler@1.4.0(@types/node@24.1.0))(@typespec/http@1.4.0(@typespec/compiler@1.4.0(@types/node@24.1.0))(@typespec/streams@0.74.0(@typespec/compiler@1.4.0(@types/node@24.1.0))))(@typespec/rest@0.74.0(@typespec/compiler@1.4.0(@types/node@24.1.0))(@typespec/http@1.4.0(@typespec/compiler@1.4.0(@types/node@24.1.0))(@typespec/streams@0.74.0(@typespec/compiler@1.4.0(@types/node@24.1.0))))) From 3500bd493cdc1119c8589b08ab220f44fb3f0ead Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Tue, 23 Sep 2025 03:44:53 +0000 Subject: [PATCH 3/5] Regenerate for typespec-python (2025-09-23 03:44:53) --- .../array/aio/operations/_operations.py | 41 ++++++++++++++++--- .../typetest/array/operations/_operations.py | 41 ++++++++++++++++--- .../dictionary/aio/operations/_operations.py | 41 ++++++++++++++++--- .../dictionary/operations/_operations.py | 41 ++++++++++++++++--- .../array/aio/operations/_operations.py | 41 ++++++++++++++++--- .../typetest/array/operations/_operations.py | 41 ++++++++++++++++--- .../dictionary/aio/operations/_operations.py | 41 ++++++++++++++++--- .../dictionary/operations/_operations.py | 41 ++++++++++++++++--- 8 files changed, 280 insertions(+), 48 deletions(-) diff --git a/packages/typespec-python/test/azure/generated/typetest-array/typetest/array/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-array/typetest/array/aio/operations/_operations.py index fe8d0bbb8b1..9508be8b3dc 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/typetest/array/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/typetest/array/aio/operations/_operations.py @@ -65,6 +65,7 @@ T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] class Int32ValueOperations: @@ -1424,6 +1425,20 @@ async def put( :raises ~azure.core.exceptions.HttpResponseError: """ + @overload + async def put(self, body: list[JSON], *, content_type: str = "application/json", **kwargs: Any) -> None: + """put. + + :param body: Required. + :type body: list[JSON] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + @overload async def put(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: """put. @@ -1439,11 +1454,11 @@ async def put(self, body: IO[bytes], *, content_type: str = "application/json", """ @distributed_trace_async - async def put(self, body: Union[list[_models.InnerModel], IO[bytes]], **kwargs: Any) -> None: + async def put(self, body: Union[list[_models.InnerModel], list[JSON], IO[bytes]], **kwargs: Any) -> None: """put. - :param body: Is either a [InnerModel] type or a IO[bytes] type. Required. - :type body: list[~typetest.array.models.InnerModel] or IO[bytes] + :param body: Is one of the following types: [InnerModel], [JSON], IO[bytes] Required. + :type body: list[~typetest.array.models.InnerModel] or list[JSON] or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -2216,6 +2231,20 @@ async def put( :raises ~azure.core.exceptions.HttpResponseError: """ + @overload + async def put(self, body: list[JSON], *, content_type: str = "application/json", **kwargs: Any) -> None: + """put. + + :param body: Required. + :type body: list[JSON] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + @overload async def put(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: """put. @@ -2231,11 +2260,11 @@ async def put(self, body: IO[bytes], *, content_type: str = "application/json", """ @distributed_trace_async - async def put(self, body: Union[list[_models.InnerModel], IO[bytes]], **kwargs: Any) -> None: + async def put(self, body: Union[list[_models.InnerModel], list[JSON], IO[bytes]], **kwargs: Any) -> None: """put. - :param body: Is either a [InnerModel] type or a IO[bytes] type. Required. - :type body: list[~typetest.array.models.InnerModel] or IO[bytes] + :param body: Is one of the following types: [InnerModel], [JSON], IO[bytes] Required. + :type body: list[~typetest.array.models.InnerModel] or list[JSON] or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: diff --git a/packages/typespec-python/test/azure/generated/typetest-array/typetest/array/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-array/typetest/array/operations/_operations.py index 6b204e88d58..74b380ee819 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/typetest/array/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/typetest/array/operations/_operations.py @@ -35,6 +35,7 @@ T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -1799,6 +1800,20 @@ def put(self, body: list[_models.InnerModel], *, content_type: str = "applicatio :raises ~azure.core.exceptions.HttpResponseError: """ + @overload + def put(self, body: list[JSON], *, content_type: str = "application/json", **kwargs: Any) -> None: + """put. + + :param body: Required. + :type body: list[JSON] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + @overload def put(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: """put. @@ -1815,12 +1830,12 @@ def put(self, body: IO[bytes], *, content_type: str = "application/json", **kwar @distributed_trace def put( # pylint: disable=inconsistent-return-statements - self, body: Union[list[_models.InnerModel], IO[bytes]], **kwargs: Any + self, body: Union[list[_models.InnerModel], list[JSON], IO[bytes]], **kwargs: Any ) -> None: """put. - :param body: Is either a [InnerModel] type or a IO[bytes] type. Required. - :type body: list[~typetest.array.models.InnerModel] or IO[bytes] + :param body: Is one of the following types: [InnerModel], [JSON], IO[bytes] Required. + :type body: list[~typetest.array.models.InnerModel] or list[JSON] or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -2599,6 +2614,20 @@ def put(self, body: list[_models.InnerModel], *, content_type: str = "applicatio :raises ~azure.core.exceptions.HttpResponseError: """ + @overload + def put(self, body: list[JSON], *, content_type: str = "application/json", **kwargs: Any) -> None: + """put. + + :param body: Required. + :type body: list[JSON] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + @overload def put(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: """put. @@ -2615,12 +2644,12 @@ def put(self, body: IO[bytes], *, content_type: str = "application/json", **kwar @distributed_trace def put( # pylint: disable=inconsistent-return-statements - self, body: Union[list[_models.InnerModel], IO[bytes]], **kwargs: Any + self, body: Union[list[_models.InnerModel], list[JSON], IO[bytes]], **kwargs: Any ) -> None: """put. - :param body: Is either a [InnerModel] type or a IO[bytes] type. Required. - :type body: list[~typetest.array.models.InnerModel] or IO[bytes] + :param body: Is one of the following types: [InnerModel], [JSON], IO[bytes] Required. + :type body: list[~typetest.array.models.InnerModel] or list[JSON] or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/typetest/dictionary/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/typetest/dictionary/aio/operations/_operations.py index 7f8744cef61..49052089f4d 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/typetest/dictionary/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/typetest/dictionary/aio/operations/_operations.py @@ -59,6 +59,7 @@ T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] class Int32ValueOperations: @@ -1418,6 +1419,20 @@ async def put( :raises ~azure.core.exceptions.HttpResponseError: """ + @overload + async def put(self, body: dict[str, JSON], *, content_type: str = "application/json", **kwargs: Any) -> None: + """put. + + :param body: Required. + :type body: dict[str, JSON] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + @overload async def put(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: """put. @@ -1433,11 +1448,11 @@ async def put(self, body: IO[bytes], *, content_type: str = "application/json", """ @distributed_trace_async - async def put(self, body: Union[dict[str, _models.InnerModel], IO[bytes]], **kwargs: Any) -> None: + async def put(self, body: Union[dict[str, _models.InnerModel], dict[str, JSON], IO[bytes]], **kwargs: Any) -> None: """put. - :param body: Is either a {str: InnerModel} type or a IO[bytes] type. Required. - :type body: dict[str, ~typetest.dictionary.models.InnerModel] or IO[bytes] + :param body: Is one of the following types: {str: InnerModel}, {str: JSON}, IO[bytes] Required. + :type body: dict[str, ~typetest.dictionary.models.InnerModel] or dict[str, JSON] or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1578,6 +1593,20 @@ async def put( :raises ~azure.core.exceptions.HttpResponseError: """ + @overload + async def put(self, body: dict[str, JSON], *, content_type: str = "application/json", **kwargs: Any) -> None: + """put. + + :param body: Required. + :type body: dict[str, JSON] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + @overload async def put(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: """put. @@ -1593,11 +1622,11 @@ async def put(self, body: IO[bytes], *, content_type: str = "application/json", """ @distributed_trace_async - async def put(self, body: Union[dict[str, _models.InnerModel], IO[bytes]], **kwargs: Any) -> None: + async def put(self, body: Union[dict[str, _models.InnerModel], dict[str, JSON], IO[bytes]], **kwargs: Any) -> None: """put. - :param body: Is either a {str: InnerModel} type or a IO[bytes] type. Required. - :type body: dict[str, ~typetest.dictionary.models.InnerModel] or IO[bytes] + :param body: Is one of the following types: {str: InnerModel}, {str: JSON}, IO[bytes] Required. + :type body: dict[str, ~typetest.dictionary.models.InnerModel] or dict[str, JSON] or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/typetest/dictionary/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/typetest/dictionary/operations/_operations.py index 3b70f8b6b45..988920870ff 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/typetest/dictionary/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/typetest/dictionary/operations/_operations.py @@ -35,6 +35,7 @@ T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -1719,6 +1720,20 @@ def put( :raises ~azure.core.exceptions.HttpResponseError: """ + @overload + def put(self, body: dict[str, JSON], *, content_type: str = "application/json", **kwargs: Any) -> None: + """put. + + :param body: Required. + :type body: dict[str, JSON] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + @overload def put(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: """put. @@ -1735,12 +1750,12 @@ def put(self, body: IO[bytes], *, content_type: str = "application/json", **kwar @distributed_trace def put( # pylint: disable=inconsistent-return-statements - self, body: Union[dict[str, _models.InnerModel], IO[bytes]], **kwargs: Any + self, body: Union[dict[str, _models.InnerModel], dict[str, JSON], IO[bytes]], **kwargs: Any ) -> None: """put. - :param body: Is either a {str: InnerModel} type or a IO[bytes] type. Required. - :type body: dict[str, ~typetest.dictionary.models.InnerModel] or IO[bytes] + :param body: Is one of the following types: {str: InnerModel}, {str: JSON}, IO[bytes] Required. + :type body: dict[str, ~typetest.dictionary.models.InnerModel] or dict[str, JSON] or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1881,6 +1896,20 @@ def put( :raises ~azure.core.exceptions.HttpResponseError: """ + @overload + def put(self, body: dict[str, JSON], *, content_type: str = "application/json", **kwargs: Any) -> None: + """put. + + :param body: Required. + :type body: dict[str, JSON] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + @overload def put(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: """put. @@ -1897,12 +1926,12 @@ def put(self, body: IO[bytes], *, content_type: str = "application/json", **kwar @distributed_trace def put( # pylint: disable=inconsistent-return-statements - self, body: Union[dict[str, _models.InnerModel], IO[bytes]], **kwargs: Any + self, body: Union[dict[str, _models.InnerModel], dict[str, JSON], IO[bytes]], **kwargs: Any ) -> None: """put. - :param body: Is either a {str: InnerModel} type or a IO[bytes] type. Required. - :type body: dict[str, ~typetest.dictionary.models.InnerModel] or IO[bytes] + :param body: Is one of the following types: {str: InnerModel}, {str: JSON}, IO[bytes] Required. + :type body: dict[str, ~typetest.dictionary.models.InnerModel] or dict[str, JSON] or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: diff --git a/packages/typespec-python/test/unbranded/generated/typetest-array/typetest/array/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-array/typetest/array/aio/operations/_operations.py index f7166abc0c3..1f196444fbe 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-array/typetest/array/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-array/typetest/array/aio/operations/_operations.py @@ -58,6 +58,7 @@ T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] class Int32ValueOperations: @@ -1366,6 +1367,20 @@ async def put( :raises ~corehttp.exceptions.HttpResponseError: """ + @overload + async def put(self, body: list[JSON], *, content_type: str = "application/json", **kwargs: Any) -> None: + """put. + + :param body: Required. + :type body: list[JSON] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + @overload async def put(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: """put. @@ -1380,11 +1395,11 @@ async def put(self, body: IO[bytes], *, content_type: str = "application/json", :raises ~corehttp.exceptions.HttpResponseError: """ - async def put(self, body: Union[list[_models.InnerModel], IO[bytes]], **kwargs: Any) -> None: + async def put(self, body: Union[list[_models.InnerModel], list[JSON], IO[bytes]], **kwargs: Any) -> None: """put. - :param body: Is either a [InnerModel] type or a IO[bytes] type. Required. - :type body: list[~typetest.array.models.InnerModel] or IO[bytes] + :param body: Is one of the following types: [InnerModel], [JSON], IO[bytes] Required. + :type body: list[~typetest.array.models.InnerModel] or list[JSON] or IO[bytes] :return: None :rtype: None :raises ~corehttp.exceptions.HttpResponseError: @@ -2128,6 +2143,20 @@ async def put( :raises ~corehttp.exceptions.HttpResponseError: """ + @overload + async def put(self, body: list[JSON], *, content_type: str = "application/json", **kwargs: Any) -> None: + """put. + + :param body: Required. + :type body: list[JSON] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + @overload async def put(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: """put. @@ -2142,11 +2171,11 @@ async def put(self, body: IO[bytes], *, content_type: str = "application/json", :raises ~corehttp.exceptions.HttpResponseError: """ - async def put(self, body: Union[list[_models.InnerModel], IO[bytes]], **kwargs: Any) -> None: + async def put(self, body: Union[list[_models.InnerModel], list[JSON], IO[bytes]], **kwargs: Any) -> None: """put. - :param body: Is either a [InnerModel] type or a IO[bytes] type. Required. - :type body: list[~typetest.array.models.InnerModel] or IO[bytes] + :param body: Is one of the following types: [InnerModel], [JSON], IO[bytes] Required. + :type body: list[~typetest.array.models.InnerModel] or list[JSON] or IO[bytes] :return: None :rtype: None :raises ~corehttp.exceptions.HttpResponseError: diff --git a/packages/typespec-python/test/unbranded/generated/typetest-array/typetest/array/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-array/typetest/array/operations/_operations.py index 0527645c7fb..4e8d0985ab5 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-array/typetest/array/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-array/typetest/array/operations/_operations.py @@ -28,6 +28,7 @@ T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -1741,6 +1742,20 @@ def put(self, body: list[_models.InnerModel], *, content_type: str = "applicatio :raises ~corehttp.exceptions.HttpResponseError: """ + @overload + def put(self, body: list[JSON], *, content_type: str = "application/json", **kwargs: Any) -> None: + """put. + + :param body: Required. + :type body: list[JSON] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + @overload def put(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: """put. @@ -1756,12 +1771,12 @@ def put(self, body: IO[bytes], *, content_type: str = "application/json", **kwar """ def put( # pylint: disable=inconsistent-return-statements - self, body: Union[list[_models.InnerModel], IO[bytes]], **kwargs: Any + self, body: Union[list[_models.InnerModel], list[JSON], IO[bytes]], **kwargs: Any ) -> None: """put. - :param body: Is either a [InnerModel] type or a IO[bytes] type. Required. - :type body: list[~typetest.array.models.InnerModel] or IO[bytes] + :param body: Is one of the following types: [InnerModel], [JSON], IO[bytes] Required. + :type body: list[~typetest.array.models.InnerModel] or list[JSON] or IO[bytes] :return: None :rtype: None :raises ~corehttp.exceptions.HttpResponseError: @@ -2511,6 +2526,20 @@ def put(self, body: list[_models.InnerModel], *, content_type: str = "applicatio :raises ~corehttp.exceptions.HttpResponseError: """ + @overload + def put(self, body: list[JSON], *, content_type: str = "application/json", **kwargs: Any) -> None: + """put. + + :param body: Required. + :type body: list[JSON] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + @overload def put(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: """put. @@ -2526,12 +2555,12 @@ def put(self, body: IO[bytes], *, content_type: str = "application/json", **kwar """ def put( # pylint: disable=inconsistent-return-statements - self, body: Union[list[_models.InnerModel], IO[bytes]], **kwargs: Any + self, body: Union[list[_models.InnerModel], list[JSON], IO[bytes]], **kwargs: Any ) -> None: """put. - :param body: Is either a [InnerModel] type or a IO[bytes] type. Required. - :type body: list[~typetest.array.models.InnerModel] or IO[bytes] + :param body: Is one of the following types: [InnerModel], [JSON], IO[bytes] Required. + :type body: list[~typetest.array.models.InnerModel] or list[JSON] or IO[bytes] :return: None :rtype: None :raises ~corehttp.exceptions.HttpResponseError: diff --git a/packages/typespec-python/test/unbranded/generated/typetest-dictionary/typetest/dictionary/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-dictionary/typetest/dictionary/aio/operations/_operations.py index 1b1e5bfcec7..f38efcc8564 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-dictionary/typetest/dictionary/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-dictionary/typetest/dictionary/aio/operations/_operations.py @@ -52,6 +52,7 @@ T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] class Int32ValueOperations: @@ -1360,6 +1361,20 @@ async def put( :raises ~corehttp.exceptions.HttpResponseError: """ + @overload + async def put(self, body: dict[str, JSON], *, content_type: str = "application/json", **kwargs: Any) -> None: + """put. + + :param body: Required. + :type body: dict[str, JSON] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + @overload async def put(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: """put. @@ -1374,11 +1389,11 @@ async def put(self, body: IO[bytes], *, content_type: str = "application/json", :raises ~corehttp.exceptions.HttpResponseError: """ - async def put(self, body: Union[dict[str, _models.InnerModel], IO[bytes]], **kwargs: Any) -> None: + async def put(self, body: Union[dict[str, _models.InnerModel], dict[str, JSON], IO[bytes]], **kwargs: Any) -> None: """put. - :param body: Is either a {str: InnerModel} type or a IO[bytes] type. Required. - :type body: dict[str, ~typetest.dictionary.models.InnerModel] or IO[bytes] + :param body: Is one of the following types: {str: InnerModel}, {str: JSON}, IO[bytes] Required. + :type body: dict[str, ~typetest.dictionary.models.InnerModel] or dict[str, JSON] or IO[bytes] :return: None :rtype: None :raises ~corehttp.exceptions.HttpResponseError: @@ -1514,6 +1529,20 @@ async def put( :raises ~corehttp.exceptions.HttpResponseError: """ + @overload + async def put(self, body: dict[str, JSON], *, content_type: str = "application/json", **kwargs: Any) -> None: + """put. + + :param body: Required. + :type body: dict[str, JSON] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + @overload async def put(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: """put. @@ -1528,11 +1557,11 @@ async def put(self, body: IO[bytes], *, content_type: str = "application/json", :raises ~corehttp.exceptions.HttpResponseError: """ - async def put(self, body: Union[dict[str, _models.InnerModel], IO[bytes]], **kwargs: Any) -> None: + async def put(self, body: Union[dict[str, _models.InnerModel], dict[str, JSON], IO[bytes]], **kwargs: Any) -> None: """put. - :param body: Is either a {str: InnerModel} type or a IO[bytes] type. Required. - :type body: dict[str, ~typetest.dictionary.models.InnerModel] or IO[bytes] + :param body: Is one of the following types: {str: InnerModel}, {str: JSON}, IO[bytes] Required. + :type body: dict[str, ~typetest.dictionary.models.InnerModel] or dict[str, JSON] or IO[bytes] :return: None :rtype: None :raises ~corehttp.exceptions.HttpResponseError: diff --git a/packages/typespec-python/test/unbranded/generated/typetest-dictionary/typetest/dictionary/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-dictionary/typetest/dictionary/operations/_operations.py index ced3e314bcd..a62d1f30ea6 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-dictionary/typetest/dictionary/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-dictionary/typetest/dictionary/operations/_operations.py @@ -28,6 +28,7 @@ T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -1661,6 +1662,20 @@ def put( :raises ~corehttp.exceptions.HttpResponseError: """ + @overload + def put(self, body: dict[str, JSON], *, content_type: str = "application/json", **kwargs: Any) -> None: + """put. + + :param body: Required. + :type body: dict[str, JSON] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + @overload def put(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: """put. @@ -1676,12 +1691,12 @@ def put(self, body: IO[bytes], *, content_type: str = "application/json", **kwar """ def put( # pylint: disable=inconsistent-return-statements - self, body: Union[dict[str, _models.InnerModel], IO[bytes]], **kwargs: Any + self, body: Union[dict[str, _models.InnerModel], dict[str, JSON], IO[bytes]], **kwargs: Any ) -> None: """put. - :param body: Is either a {str: InnerModel} type or a IO[bytes] type. Required. - :type body: dict[str, ~typetest.dictionary.models.InnerModel] or IO[bytes] + :param body: Is one of the following types: {str: InnerModel}, {str: JSON}, IO[bytes] Required. + :type body: dict[str, ~typetest.dictionary.models.InnerModel] or dict[str, JSON] or IO[bytes] :return: None :rtype: None :raises ~corehttp.exceptions.HttpResponseError: @@ -1817,6 +1832,20 @@ def put( :raises ~corehttp.exceptions.HttpResponseError: """ + @overload + def put(self, body: dict[str, JSON], *, content_type: str = "application/json", **kwargs: Any) -> None: + """put. + + :param body: Required. + :type body: dict[str, JSON] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + @overload def put(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: """put. @@ -1832,12 +1861,12 @@ def put(self, body: IO[bytes], *, content_type: str = "application/json", **kwar """ def put( # pylint: disable=inconsistent-return-statements - self, body: Union[dict[str, _models.InnerModel], IO[bytes]], **kwargs: Any + self, body: Union[dict[str, _models.InnerModel], dict[str, JSON], IO[bytes]], **kwargs: Any ) -> None: """put. - :param body: Is either a {str: InnerModel} type or a IO[bytes] type. Required. - :type body: dict[str, ~typetest.dictionary.models.InnerModel] or IO[bytes] + :param body: Is one of the following types: {str: InnerModel}, {str: JSON}, IO[bytes] Required. + :type body: dict[str, ~typetest.dictionary.models.InnerModel] or dict[str, JSON] or IO[bytes] :return: None :rtype: None :raises ~corehttp.exceptions.HttpResponseError: From 2d7c18cae4e7f37419b66c7f7375d5c548111f4c Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Tue, 23 Sep 2025 12:53:30 +0800 Subject: [PATCH 4/5] add test case --- .../asynctests/test_typetest_array_async.py | 9 +++++++++ .../test/generic_mock_api_tests/test_typetest_array.py | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/packages/typespec-python/test/generic_mock_api_tests/asynctests/test_typetest_array_async.py b/packages/typespec-python/test/generic_mock_api_tests/asynctests/test_typetest_array_async.py index 26573428b29..180887ea765 100644 --- a/packages/typespec-python/test/generic_mock_api_tests/asynctests/test_typetest_array_async.py +++ b/packages/typespec-python/test/generic_mock_api_tests/asynctests/test_typetest_array_async.py @@ -58,6 +58,7 @@ async def test_model_value(client: ArrayClient): models.InnerModel(property="hello"), models.InnerModel(property="world"), ] + # test list[model] await client.model_value.put( [ models.InnerModel(property="hello"), @@ -65,6 +66,14 @@ async def test_model_value(client: ArrayClient): ] ) + # test list[JSON] + await client.model_value.put( + [ + {"property": "hello"}, + {"property": "world"}, + ] + ) + @pytest.mark.asyncio async def test_nullable_boolean_value(client: ArrayClient): diff --git a/packages/typespec-python/test/generic_mock_api_tests/test_typetest_array.py b/packages/typespec-python/test/generic_mock_api_tests/test_typetest_array.py index 0ab85a86f8b..0c3c0f3f065 100644 --- a/packages/typespec-python/test/generic_mock_api_tests/test_typetest_array.py +++ b/packages/typespec-python/test/generic_mock_api_tests/test_typetest_array.py @@ -50,12 +50,20 @@ def test_model_value(client: ArrayClient): models.InnerModel(property="hello"), models.InnerModel(property="world"), ] + # test list[model] client.model_value.put( [ models.InnerModel(property="hello"), models.InnerModel(property="world"), ] ) + # test list[JSON] + client.model_value.put( + [ + {"property": "hello"}, + {"property": "world"}, + ] + ) def test_nullable_boolean_value(client: ArrayClient): From f2c72b7b80e7f5bb74bf432f37f50678a0154a4e Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Tue, 23 Sep 2025 12:54:47 +0800 Subject: [PATCH 5/5] add changelog --- ...-iscai-msft-python-listOverloads-2025-8-23-12-54-34.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .chronus/changes/auto-iscai-msft-python-listOverloads-2025-8-23-12-54-34.md diff --git a/.chronus/changes/auto-iscai-msft-python-listOverloads-2025-8-23-12-54-34.md b/.chronus/changes/auto-iscai-msft-python-listOverloads-2025-8-23-12-54-34.md new file mode 100644 index 00000000000..a7510331780 --- /dev/null +++ b/.chronus/changes/auto-iscai-msft-python-listOverloads-2025-8-23-12-54-34.md @@ -0,0 +1,8 @@ +--- +changeKind: fix +packages: + - "@autorest/python" + - "@azure-tools/typespec-python" +--- + +Add overload for operation when body type is array of model \ No newline at end of file