go-travis
go-travis copied to clipboard
Cannot unmarshal object into Go struct field Request.branch_name of type string
To replicate: Requests.FindByRepoId API call
opt := &travis.RequestOption{Include: []string{"request.repository"}}
request, res, err := client.Requests.FindByRepoId(context.Background(), 123, 456, opt)
Error
json: cannot unmarshal object into Go struct field Request.branch_name of type string
Go lang structure
type Request struct {
// Name of the branch requested to be built
BranchName *string `json:"branch_name,omitempty"`
...
Actual response
"branch_name": {
"@type": "branch",
"@href": "/api/repo/123/branch/master",
"@representation": "minimal",
"name": "master"
},