Skip to content

API v2 projects/{projectId}/clusters does not parse correctly #6

@kkostial

Description

@kkostial

It seems to me that the api spec for the endpoint
https://docs.kubermatic.com/kubermatic/v2.28/references/rest-api-reference/#/project/listClustersV2
does not match the generated go code.

The code says:

type ListClustersV2OK struct {
	Payload models.ClusterList
}

and that Payload type is just a slice of Clusters.
However the response actually contains a field called "clusters".

Therefore it cannot map the response properly and fails.

The actual api call succeeds, just not parsing the result.
"json: cannot unmarshal object into Go value of type models.ClusterList"

KKP Version is 2.28 and client too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions