Skip to content
This repository was archived by the owner on Feb 5, 2024. It is now read-only.

Cannot unmarshal object into Go struct field Request.branch_name of type string #79

Open
dvasilen opened this issue Apr 20, 2021 · 0 comments

Comments

@dvasilen
Copy link

dvasilen commented Apr 20, 2021

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"
  },
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant