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

Automation GetContent functions wrongly use ByUnmarshallingJSON #2486

Closed
bgelens opened this issue Aug 18, 2018 · 7 comments
Closed

Automation GetContent functions wrongly use ByUnmarshallingJSON #2486

bgelens opened this issue Aug 18, 2018 · 7 comments
Assignees
Labels
Automation customer-reported Issues that are reported by GitHub users external to the Azure organization.

Comments

@bgelens
Copy link

bgelens commented Aug 18, 2018

Bug Report

  • import path of package - .../services/automation/mgmt/2015-10-31/automation
  • SDK version - 18.0.0
  • output of go version - go version go1.10.3 windows/amd6
  • What happened?
    Trying to make use of GetContent from dscconfiguration. The api call will return just a string and not a json body. GetContentResponder however is trying to Unmarshal a json object resulting in an error.

automation.DscConfigurationClient#GetContent: Failure responding to request: StatusCode=200 -- Original Error: Error occurred unmarshalling JSON - Error = 'invalid character 'c'
looking for beginning of value' JSON = 'configuration bla {}'

  • What did you expect or want to happen?
    Just return the string, do not attempt to unmarshal as it is not a json object that is returned

  • How can we reproduce it?
    Call the GetContent function.

@jhendrixMSFT
Copy link
Member

I believe this is a problem with the swagger as the return type specified is string, needs confirmation.

@vladbarosan vladbarosan self-assigned this Aug 20, 2018
@vladbarosan
Copy link

Investigating, it might be an issue with the generator. If so will have a fix in the next sdk release.

@vladbarosan
Copy link

@bgelens out of curiosity are you receiving any content type header ?

@bgelens
Copy link
Author

bgelens commented Aug 21, 2018

@vladbarosan I get text/powershell as content type

@bgelens
Copy link
Author

bgelens commented Aug 21, 2018

Just fyi, with runbookdraft and runbook there is no unmarshaling happening. The content type there is text/powershell as well.

@jhendrixMSFT
Copy link
Member

This has been fixed in https://github.com/Azure/azure-sdk-for-go/releases/tag/v20.0.0

@ghost ghost removed the committed label Aug 30, 2018
@bgelens
Copy link
Author

bgelens commented Aug 31, 2018

Awesome! Thanks 👍

@RickWinter RickWinter added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Jul 12, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Automation customer-reported Issues that are reported by GitHub users external to the Azure organization.
Projects
None yet
Development

No branches or pull requests

4 participants