mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-20 04:17:11 +00:00
* deserialize enum json response (python) * adapt python samples: adding enum deserialization * add echo test for enum json response deserialization (python) * update samples
This commit is contained in:
@@ -666,3 +666,77 @@ function Test-EchoBodyAllOfPet {
|
||||
}
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
|
||||
Test string enum response body
|
||||
|
||||
.DESCRIPTION
|
||||
|
||||
No description available.
|
||||
|
||||
.PARAMETER Body
|
||||
String enum
|
||||
|
||||
.PARAMETER WithHttpInfo
|
||||
|
||||
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
|
||||
|
||||
.OUTPUTS
|
||||
|
||||
StringEnumRef
|
||||
#>
|
||||
function Test-EchoBodyStringEnum {
|
||||
[CmdletBinding()]
|
||||
Param (
|
||||
[Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
|
||||
[System.Nullable[String]]
|
||||
${Body},
|
||||
[Switch]
|
||||
$WithHttpInfo
|
||||
)
|
||||
|
||||
Process {
|
||||
'Calling method: Test-EchoBodyStringEnum' | Write-Debug
|
||||
$PSBoundParameters | Out-DebugParameter | Write-Debug
|
||||
|
||||
$LocalVarAccepts = @()
|
||||
$LocalVarContentTypes = @()
|
||||
$LocalVarQueryParameters = @{}
|
||||
$LocalVarHeaderParameters = @{}
|
||||
$LocalVarFormParameters = @{}
|
||||
$LocalVarPathParameters = @{}
|
||||
$LocalVarCookieParameters = @{}
|
||||
$LocalVarBodyParameter = $null
|
||||
|
||||
$Configuration = Get-Configuration
|
||||
# HTTP header 'Accept' (if needed)
|
||||
$LocalVarAccepts = @('application/json')
|
||||
|
||||
# HTTP header 'Content-Type'
|
||||
$LocalVarContentTypes = @('application/json')
|
||||
|
||||
$LocalVarUri = '/echo/body/string_enum'
|
||||
|
||||
$LocalVarBodyParameter = $Body | ConvertTo-Json -Depth 100
|
||||
|
||||
$LocalVarResult = Invoke-ApiClient -Method 'POST' `
|
||||
-Uri $LocalVarUri `
|
||||
-Accepts $LocalVarAccepts `
|
||||
-ContentTypes $LocalVarContentTypes `
|
||||
-Body $LocalVarBodyParameter `
|
||||
-HeaderParameters $LocalVarHeaderParameters `
|
||||
-QueryParameters $LocalVarQueryParameters `
|
||||
-FormParameters $LocalVarFormParameters `
|
||||
-CookieParameters $LocalVarCookieParameters `
|
||||
-ReturnType "StringEnumRef" `
|
||||
-IsBodyNullable $false
|
||||
|
||||
if ($WithHttpInfo.IsPresent) {
|
||||
return $LocalVarResult
|
||||
} else {
|
||||
return $LocalVarResult["Response"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user