Azure / azure-sdk-for-go

This repository is for active development of the Azure SDK for Go. For consumers of the SDK we recommend visiting our public developer docs at:
https://docs.microsoft.com/azure/developer/go/
MIT License
1.63k stars 835 forks source link

HDInsight Location Client Fails to Deserialize VersionSpec Model #14238

Closed jamisonhyatt closed 3 years ago

jamisonhyatt commented 3 years ago

Bug Report

require ( github.com/Azure/azure-sdk-for-go v50.2.0+incompatible github.com/Azure/go-autorest/autorest/azure/auth v0.5.6 github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect )


- output of `go version` : `go version go1.15.7 darwin/amd64`

<!--
and please describe:
-->
- Gist to reproduce: https://gist.github.com/jamisonhyatt/20e01c5837c15165fca566bf459516c7
- What happened: Successful (200) API calls with a valid response returns an error during deserialization within the `hdinsight.LocationsClient`

> hdinsight.LocationsClient#GetCapabilities: Failure responding to request: StatusCode=200 -- Original Error: Error occurred unmarshalling JSON - Error = 'json: cannot unmarshal bool into Go struct field VersionSpec.versions.available.isDefault of type string'

- What did you expect or want to happen:  No deserialization error
- How can we reproduce it:  via this [gist](https://gist.github.com/jamisonhyatt/20e01c5837c15165fca566bf459516c7) or any call that attempts to deserialize the model `hdinsight.VersionSpec`: https://github.com/Azure/azure-sdk-for-go/blob/5aff21717612661044ca766fd0d3981c5010db57/services/hdinsight/mgmt/2018-06-01/hdinsight/models.go#L2173
- Anything we should know about your environment: nope

I verified locally that altering the type of IsDefault to *bool instead of *string in the above model does solve the problem.  Is a PR with the type change the right way to fix this, or is it more involved?
ArcturusZhang commented 3 years ago

Hi @jamisonhyatt thanks for this issue and sorry for the inconvenience!

We do know this issue, which comes from a swagger mistake. We just fixed this in the swagger 6 days ago (see this PR) but this fix causes breaking changes in this package, we have to release it in the next major version (end of this month). In the new version, this issue will be resolved.

aim-for-better commented 3 years ago

Checking

aim-for-better commented 3 years ago

As Arcturus said, this has been fixed from swagger spec side, we will update related sdk soon.

ArcturusZhang commented 3 years ago

As Arcturus said, this has been fixed from swagger spec side, we will update related sdk soon.

I know that we have released a new version for hdinsight recently, but could you please make another release request to make sure that we would not miss this package in the next major version release?

aim-for-better commented 3 years ago

As Arcturus said, this has been fixed from swagger spec side, we will update related sdk soon.

I know that we have released a new version for hdinsight recently, but could you please make another release request to make sure that we would not miss this package in the next major version release?

Now we need to hold on the release request. there are still some ongoning changes.

aim-for-better commented 3 years ago

Still need to wait some days.

aim-for-better commented 3 years ago

still need to wait, we will release it soon.

aim-for-better commented 3 years ago

The Go SDK team is working on releasing. Hi @ArcturusZhang could you please check the release request?

ArcturusZhang commented 3 years ago

The Go SDK team is working on releasing. Hi @ArcturusZhang could you please check the release request?

This will be released in next week's major version.

aim-for-better commented 3 years ago

Hi @ArcturusZhang Is the Go SDK available now? Thanks~

ArcturusZhang commented 3 years ago

We have released an update for hdinsight in v54.0.0, and this property has been changed to bool here: https://github.com/Azure/azure-sdk-for-go/blob/f531174e50dc985270a91713d205c6ddc449e378/services/hdinsight/mgmt/2018-06-01/hdinsight/models.go#L2777

I suppose this has been fixed, therefore I am going to close this issue, thank you @aim-for-better ! @jamisonhyatt could you please also have a test using the latest version of the SDK?