From e70a9564e0eab722a89ac69395e302ec100904c9 Mon Sep 17 00:00:00 2001 From: condorcorde <49915099+condorcorde@users.noreply.github.com> Date: Tue, 13 Aug 2024 09:20:46 +0200 Subject: [PATCH] [PowerShell] Fix missing Content-Type header on a 204 response (#19340) * Allow for binary response content * AllowNull for $ContentTypes * Update PSApiClient.ps1 --- .../src/main/resources/powershell/api_client.mustache | 1 + .../echo_api/powershell/src/PSOpenAPITools/Private/ApiClient.ps1 | 1 + .../petstore/powershell/src/PSPetstore/Private/PSApiClient.ps1 | 1 + 3 files changed, 3 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/powershell/api_client.mustache b/modules/openapi-generator/src/main/resources/powershell/api_client.mustache index 2e6cb8647ce..69cac6ca809 100644 --- a/modules/openapi-generator/src/main/resources/powershell/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/api_client.mustache @@ -235,6 +235,7 @@ function DeserializeResponse { [Parameter(Mandatory)] [Object]$Response, [Parameter(Mandatory)] + [AllowNull()] [AllowEmptyCollection()] [string[]]$ContentTypes ) diff --git a/samples/client/echo_api/powershell/src/PSOpenAPITools/Private/ApiClient.ps1 b/samples/client/echo_api/powershell/src/PSOpenAPITools/Private/ApiClient.ps1 index 08c35f11b33..95094512d35 100644 --- a/samples/client/echo_api/powershell/src/PSOpenAPITools/Private/ApiClient.ps1 +++ b/samples/client/echo_api/powershell/src/PSOpenAPITools/Private/ApiClient.ps1 @@ -223,6 +223,7 @@ function DeserializeResponse { [Parameter(Mandatory)] [Object]$Response, [Parameter(Mandatory)] + [AllowNull()] [AllowEmptyCollection()] [string[]]$ContentTypes ) diff --git a/samples/client/petstore/powershell/src/PSPetstore/Private/PSApiClient.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Private/PSApiClient.ps1 index 4bd3084c7e4..1dc3939d315 100755 --- a/samples/client/petstore/powershell/src/PSPetstore/Private/PSApiClient.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Private/PSApiClient.ps1 @@ -239,6 +239,7 @@ function DeserializeResponse { [Parameter(Mandatory)] [Object]$Response, [Parameter(Mandatory)] + [AllowNull()] [AllowEmptyCollection()] [string[]]$ContentTypes )