Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
5 of 6 tasks
Stuv7CB opened this issue Dec 7, 2023 · 1 comment · Fixed by #17342
Closed
5 of 6 tasks

Comments

@Stuv7CB
Copy link
Contributor

Stuv7CB commented Dec 7, 2023

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
@wing328
Copy link
Member

wing328 commented Dec 7, 2023

thanks for reporting the issue

can you please file a PR with the suggested fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants