Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ function {{{vendorExtensions.x-powershell-method-name}}} {
{{/isNullable}}
{{/required}}
{{#isArray}}
$LocalVarBodyParameter = ,${{{paramName}}} | ConvertTo-Json -Depth 100
$LocalVarBodyParameter = ConvertTo-Json @(${{{paramName}}}) -Depth 100
{{/isArray}}
{{^isArray}}
$LocalVarBodyParameter = ${{{paramName}}} | ConvertTo-Json -Depth 100
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function New-PSUsersWithArrayInput {
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' `
-Uri $LocalVarUri `
Expand Down Expand Up @@ -208,7 +208,7 @@ function New-PSUsersWithListInput {
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' `
-Uri $LocalVarUri `
Expand Down
Loading