microsoft/azure-devops-go-api

GetReleaseDefinition fails when using scheduled days

Opened this issue · 1 comments

When using this config in Azure DevOps:
bilde

We get this error:
"json: cannot unmarshal number into Go struct field ReleaseSchedule.environments.schedules.daysToRelease of type release.ScheduleDays"

Returned from:
releaseDefinitionObject, err := releaseClient.GetReleaseDefinition(ctx,
getReleaseDefinitionArgs)
if err != nil {
log.Fatal(err)
}

Its this function that is throwing the error:

func (client *Client) UnmarshalBody(response *http.Response, v interface{}) (err error) {

And it is used by the function:

func (client *ClientImpl) GetReleaseDefinition(ctx context.Context, args GetReleaseDefinitionArgs) (*ReleaseDefinition, error) {

I confirm this one
The library uses string names like "none", "Monday", "tuesday", "all", but in actual response from API we get both numbers and string numbers like 42 or "127"
Screenshot 2024-01-17 at 11 24 05
Screenshot 2024-01-17 at 11 24 13