Skip to content

Commit

Permalink
Support multiple files (OpenAPITools#19449)
Browse files Browse the repository at this point in the history
  • Loading branch information
condorcorde authored Aug 26, 2024
1 parent f13a11b commit fe381e2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function {{{vendorExtensions.x-powershell-method-name}}} {
throw "Error! The required parameter `{{paramName}}` missing when calling {{operationId}}."
}
{{#isFile}}
$LocalVarFormParameters['{{baseName}}'] = $executionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath(${{{paramName}}})
$LocalVarFormParameters['{{baseName}}'] = ${{{paramName}}} | Foreach-Object { [System.IO.FileInfo]$executionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($_) }
{{/isFile}}
{{^isFile}}
$LocalVarFormParameters['{{baseName}}'] = ${{{paramName}}}
Expand All @@ -159,7 +159,7 @@ function {{{vendorExtensions.x-powershell-method-name}}} {
{{^isNullable}}
if (${{{paramName}}}) {
{{#isFile}}
$LocalVarFormParameters['{{baseName}}'] = $executionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath(${{{paramName}}})
$LocalVarFormParameters['{{baseName}}'] = ${{{paramName}}} | Foreach-Object { [System.IO.FileInfo]$executionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($_) }
{{/isFile}}
{{^isFile}}
$LocalVarFormParameters['{{baseName}}'] = ${{{paramName}}}
Expand All @@ -169,7 +169,7 @@ function {{{vendorExtensions.x-powershell-method-name}}} {
{{/isNullable}}
{{#isNullable}}
{{#isFile}}
$LocalVarFormParameters['{{baseName}}'] = $executionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath(${{{paramName}}})
$LocalVarFormParameters['{{baseName}}'] = ${{{paramName}}} | Foreach-Object { [System.IO.FileInfo]$executionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($_) }
{{/isFile}}
{{^isFile}}
$LocalVarFormParameters['{{baseName}}'] = ${{{paramName}}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ function Test-BodyMultipartFormdataArrayOfBinary {
if (!$Files) {
throw "Error! The required parameter `Files` missing when calling test_body_multipart_formdata_arrayOfBinary."
}
$LocalVarFormParameters['files'] = $executionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($Files)
$LocalVarFormParameters['files'] = $Files | Foreach-Object { [System.IO.FileInfo]$executionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($_) }

$LocalVarResult = Invoke-ApiClient -Method 'POST' `
-Uri $LocalVarUri `
Expand Down Expand Up @@ -273,7 +273,7 @@ function Test-BodyMultipartFormdataSingleBinary {
$LocalVarUri = '/body/application/octetstream/single_binary'

if ($MyFile) {
$LocalVarFormParameters['my-file'] = $executionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($MyFile)
$LocalVarFormParameters['my-file'] = $MyFile | Foreach-Object { [System.IO.FileInfo]$executionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($_) }
}

$LocalVarResult = Invoke-ApiClient -Method 'POST' `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ function Test-PSEndpointParameters {
$LocalVarFormParameters['byte'] = $Byte

if ($Binary) {
$LocalVarFormParameters['binary'] = $executionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($Binary)
$LocalVarFormParameters['binary'] = $Binary | Foreach-Object { [System.IO.FileInfo]$executionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($_) }
}

if ($Date) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ function Invoke-PSUploadFile {
}

if ($File) {
$LocalVarFormParameters['file'] = $executionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($File)
$LocalVarFormParameters['file'] = $File | Foreach-Object { [System.IO.FileInfo]$executionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($_) }
}


Expand Down Expand Up @@ -778,7 +778,7 @@ function Invoke-PSUploadFileWithRequiredFile {
if (!$RequiredFile) {
throw "Error! The required parameter `RequiredFile` missing when calling uploadFileWithRequiredFile."
}
$LocalVarFormParameters['requiredFile'] = $executionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($RequiredFile)
$LocalVarFormParameters['requiredFile'] = $RequiredFile | Foreach-Object { [System.IO.FileInfo]$executionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($_) }


$LocalVarResult = Invoke-PSApiClient -Method 'POST' `
Expand Down

0 comments on commit fe381e2

Please sign in to comment.