Skip to content

[BUG][POWERSHELL] Powershell client should use $Response.Content for deserializing response #17340

Closed
@Stuv7CB

Description

@Stuv7CB

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue? Not applicable
  • Have you validated the input using an OpenAPI validator (example)? Not applicable
  • 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

Powershell client should use $Response.Content for deserializing response. Converting $Response to string as is replaces non-ascii characters with ?

Response = DeserializeResponse -Response $Response -ReturnType $ReturnType -ContentTypes $Response.Headers["Content-Type"]

Proof in source code of powershell: https://github.com/PowerShell/PowerShell/blob/9489629f769061e3ff40f155fd2ce9a0a6c4334a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebResponseObject.Common.cs#L175

Encoding.ASCII.GetChars(Content)

openapi-generator version

master

OpenAPI declaration file content or url
Generation Details

Generate powershell client

Steps to reproduce

Invoke request to api with non-uncode characters in response

Expected: character parsed correctly
Actual: Bunch of ????? instead of character

Related issues/PRs
Suggest a fix

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions