goharbor / go-client

Client library with golang for accessing Harbor API.
Apache License 2.0
39 stars 18 forks source link

Listing Artifacts and Repositories returns a swagger error #18

Open alireza-mht opened 1 year ago

alireza-mht commented 1 year ago

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

shenshouer commented 11 months ago

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

Vad1mo commented 7 months ago

do you still see that issue?

Piwriw commented 5 months ago

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

Vad1mo commented 5 months ago

are you using the latest version of the library?

Piwriw commented 5 months ago

are you using the latest version of the library?

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