azure-sdk-for-go: RecoveryPointTierType Unmarshalling JSON Error

Bug Report - RecoveryPointTierType Unmarshalling JSON Error

  • import path: .../services/recoveryservices/mgmt/2020-02-02/backup
  • SDK version master
  • Go version: go version go1.13.4 linux/amd64

If I try to list or get a Recovery Point I get and Unmarshalling Error. One example SDK call could be:

	rpClient := backup.NewRecoveryPointsClient(sess.SubscriptionID)
        ...
        rpList, err := rpClient.List(...)

The error produced by the previous code is:

2020/07/30 09:52:04 backup.RecoveryPointsClient#List: Failure responding to request: StatusCode=200 -- Original Error: Error occurred unmarshalling JSON - Error = 'json: cannot unmarshal number into Go struct field RecoveryPointResourceList.value of type backup.RecoveryPointTierType'

Taking a further look I saw that there is an inconsistency between what the Go SDK expects and what the GET call returns, as the http request returns an integer and the SDK expects a string for the RecoveryPointTierType value. Example output:

..."recoveryPointTierDetails":[{"type":1,"status":1},{"type":2,"status":1}],...

For the field type the sdk expects a string => SDK code

Is is an API version problem?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

@cohenjo We will get back on this by end of this month

“This should be a swagger issue - the swagger definition is not consistent with what the API returns.” @ArcturusZhang : Thanks for helping to narrow down the probable root cause.

Forwarding this to my service team for investigation.

Hi @rogercoll thanks for this issue!

This should be a swagger issue - the swagger definition is not consistent with what the API returns.

I have tagged this issue so that the corresponding service team will have a look at this.