Revert "Add support for string response deserialization (#12910)"

This reverts commit b8524bee23.
This commit is contained in:
William Cheng
2022-07-21 12:58:46 +08:00
parent b8524bee23
commit c26e19cbc0
123 changed files with 10025 additions and 76 deletions

View File

@@ -0,0 +1,97 @@
#
# OpenAPI Petstore
# This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: "" \
# Version: 1.0.0
# Generated by OpenAPI Generator: https://openapi-generator.tech
#
<#
.SYNOPSIS
No summary available.
.DESCRIPTION
No description available.
.PARAMETER Breed
No description available.
.OUTPUTS
DogAllOf<PSCustomObject>
#>
function Initialize-PSDogAllOf {
[CmdletBinding()]
Param (
[Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
[String]
${Breed}
)
Process {
'Creating PSCustomObject: PSPetstore => PSDogAllOf' | Write-Debug
$PSBoundParameters | Out-DebugParameter | Write-Debug
$PSO = [PSCustomObject]@{
"breed" = ${Breed}
}
return $PSO
}
}
<#
.SYNOPSIS
Convert from JSON to DogAllOf<PSCustomObject>
.DESCRIPTION
Convert from JSON to DogAllOf<PSCustomObject>
.PARAMETER Json
Json object
.OUTPUTS
DogAllOf<PSCustomObject>
#>
function ConvertFrom-PSJsonToDogAllOf {
Param(
[AllowEmptyString()]
[string]$Json
)
Process {
'Converting JSON to PSCustomObject: PSPetstore => PSDogAllOf' | Write-Debug
$PSBoundParameters | Out-DebugParameter | Write-Debug
$JsonParameters = ConvertFrom-Json -InputObject $Json
# check if Json contains properties not defined in PSDogAllOf
$AllProperties = ("breed")
foreach ($name in $JsonParameters.PsObject.Properties.Name) {
if (!($AllProperties.Contains($name))) {
throw "Error! JSON key '$name' not found in the properties: $($AllProperties)"
}
}
if (!([bool]($JsonParameters.PSobject.Properties.name -match "breed"))) { #optional property not found
$Breed = $null
} else {
$Breed = $JsonParameters.PSobject.Properties["breed"].value
}
$PSO = [PSCustomObject]@{
"breed" = ${Breed}
}
return $PSO
}
}