-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Closed
Labels
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
The -WithHttpInfo uses the $Response.Headers['Content-Type'] which may not always be set. Therefore this may result in Null which is not accepted by the DeserializeResponse function.
openapi-generator version
v5.0.0
Steps to reproduce
- Generate any Powershell client
- Run -WithHttpInfo on an endpoint that doesnt set the content type
Suggest a fix
(ApiClient.ps1)
Either let DeserializeResponse accept null values or use the following for the content type:
$contentTypes = $Response.Headers["Content-Type"]
if ($null -eq $contentTypes) {
$contentTypes = [string[]]@()
}
# Use this in subsequent DeserializeResponse
Reactions are currently unavailable