fix(client): decode wrapped keypairs list response #1

Merged
gharvey merged 1 commit from fix/keypair-list-decode-ns into main 2026-08-03 19:19:58 +00:00
Owner

GET /compute/keypairs returns {"keypairs": [...]}, but ListKeypairs
decoded the body into a bare []Keypair. Every keypair read therefore
failed with:

json: cannot unmarshal object into Go value of type []client.Keypair

Since GetKeypair is built on ListKeypairs, this broke Read for the
patrii_keypair resource against the live API. Add a KeypairsResponse
wrapper mirroring SecurityGroupsResponse, and update the keypair test
mocks to serve the real wrapped shape.

GET /compute/keypairs returns {"keypairs": [...]}, but ListKeypairs decoded the body into a bare []Keypair. Every keypair read therefore failed with: json: cannot unmarshal object into Go value of type []client.Keypair Since GetKeypair is built on ListKeypairs, this broke Read for the patrii_keypair resource against the live API. Add a KeypairsResponse wrapper mirroring SecurityGroupsResponse, and update the keypair test mocks to serve the real wrapped shape.
GET /compute/keypairs returns {"keypairs": [...]}, but ListKeypairs
decoded the body into a bare []Keypair. Every keypair read therefore
failed with:

  json: cannot unmarshal object into Go value of type []client.Keypair

Since GetKeypair is built on ListKeypairs, this broke Read for the
patrii_keypair resource against the live API. Add a KeypairsResponse
wrapper mirroring SecurityGroupsResponse, and update the keypair test
mocks to serve the real wrapped shape.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Patrii/terraform!1
No description provided.