go-client icon indicating copy to clipboard operation
go-client copied to clipboard

Listing Artifacts and Repositories returns a swagger error

Open alireza-mht opened this issue 11 months ago • 5 comments

I'm using the below code to get the list of Repositories from harbor:

c := &harbor.ClientSetConfig{
               URL:      h.url,
		Password: h.password,
		Username: h.username,
		Insecure: true,
	}
cs, err := harbor.NewClientSet(c)
if err != nil {
	return "", err
}
v2Client := cs.V2()
_, err := v2Client.Repository.ListRepositories(context.TODO(), repository.NewListRepositoriesParams().WithProjectName(h.projectName))
if err != nil {
		fmt.Println(err)
}

And I get the below error:

&[] (*[]*models.Repository) is not supported by the TextConsumer, can be resolved by supporting TextUnmarshaler interface

Expected result: Should get the exact REST API error code

golang version: 1.20 linux/amd64

alireza-mht avatar Jul 28 '23 15:07 alireza-mht

I met the same issue, How to do with it?

shenshouer avatar Sep 12 '23 04:09 shenshouer

do you still see that issue?

Vad1mo avatar Jan 25 '24 13:01 Vad1mo

I met the same issue, How to do with it?

Piwriw avatar Mar 08 '24 08:03 Piwriw

are you using the latest version of the library?

Vad1mo avatar Mar 08 '24 08:03 Vad1mo

are you using the latest version of the library?

yes,the version is v0.210.0, and Go version is 1.19

Piwriw avatar Mar 08 '24 09:03 Piwriw