fix(client): decode wrapped keypairs list response #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/keypair-list-decode-ns"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.