forked from loafle/openapi-generator-original
Fixed the empty string issue when server returns null (#7633)
This commit is contained in:
@@ -185,7 +185,7 @@ function DeserializeResponse {
|
|||||||
[string[]]$ContentTypes
|
[string[]]$ContentTypes
|
||||||
)
|
)
|
||||||
|
|
||||||
If ([string]::IsNullOrEmpty($ReturnType)) { # void response
|
If ([string]::IsNullOrEmpty($ReturnType) -and $ContentTypes.Count -eq 0) { # void response
|
||||||
return $Response
|
return $Response
|
||||||
} Elseif ($ReturnType -match '\[\]$') { # array
|
} Elseif ($ReturnType -match '\[\]$') { # array
|
||||||
return ConvertFrom-Json $Response
|
return ConvertFrom-Json $Response
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ function DeserializeResponse {
|
|||||||
[string[]]$ContentTypes
|
[string[]]$ContentTypes
|
||||||
)
|
)
|
||||||
|
|
||||||
If ([string]::IsNullOrEmpty($ReturnType)) { # void response
|
If ([string]::IsNullOrEmpty($ReturnType) -and $ContentTypes.Count -eq 0) { # void response
|
||||||
return $Response
|
return $Response
|
||||||
} Elseif ($ReturnType -match '\[\]$') { # array
|
} Elseif ($ReturnType -match '\[\]$') { # array
|
||||||
return ConvertFrom-Json $Response
|
return ConvertFrom-Json $Response
|
||||||
|
|||||||
Reference in New Issue
Block a user