[POWERSHELL] fix: keep array context when converting to json (#19535)

This commit is contained in:
Syd Besco 2024-10-03 09:57:21 +02:00 committed by GitHub
parent 6686c4d02f
commit 9f2bd313ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -188,7 +188,7 @@ function {{{vendorExtensions.x-powershell-method-name}}} {
{{/isNullable}} {{/isNullable}}
{{/required}} {{/required}}
{{#isArray}} {{#isArray}}
$LocalVarBodyParameter = ,${{{paramName}}} | ConvertTo-Json -Depth 100 $LocalVarBodyParameter = ConvertTo-Json @(${{{paramName}}}) -Depth 100
{{/isArray}} {{/isArray}}
{{^isArray}} {{^isArray}}
$LocalVarBodyParameter = ${{{paramName}}} | ConvertTo-Json -Depth 100 $LocalVarBodyParameter = ${{{paramName}}} | ConvertTo-Json -Depth 100

View File

@ -133,7 +133,7 @@ function New-PSUsersWithArrayInput {
throw "Error! The required parameter `User` missing when calling createUsersWithArrayInput." throw "Error! The required parameter `User` missing when calling createUsersWithArrayInput."
} }
$LocalVarBodyParameter = ,$User | ConvertTo-Json -Depth 100 $LocalVarBodyParameter = ConvertTo-Json @($User) -Depth 100
$LocalVarResult = Invoke-PSApiClient -Method 'POST' ` $LocalVarResult = Invoke-PSApiClient -Method 'POST' `
-Uri $LocalVarUri ` -Uri $LocalVarUri `
@ -208,7 +208,7 @@ function New-PSUsersWithListInput {
throw "Error! The required parameter `User` missing when calling createUsersWithListInput." throw "Error! The required parameter `User` missing when calling createUsersWithListInput."
} }
$LocalVarBodyParameter = ,$User | ConvertTo-Json -Depth 100 $LocalVarBodyParameter = ConvertTo-Json @($User) -Depth 100
$LocalVarResult = Invoke-PSApiClient -Method 'POST' ` $LocalVarResult = Invoke-PSApiClient -Method 'POST' `
-Uri $LocalVarUri ` -Uri $LocalVarUri `