forked from loafle/openapi-generator-original
Support multiple files (#19449)
This commit is contained in:
parent
f13a11b53c
commit
fe381e2199
@ -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}}}
|
||||
@ -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}}}
|
||||
@ -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}}}
|
||||
|
@ -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 `
|
||||
@ -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' `
|
||||
|
@ -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) {
|
||||
|
@ -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($_) }
|
||||
}
|
||||
|
||||
|
||||
@ -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' `
|
||||
|
Loading…
x
Reference in New Issue
Block a user