From 3c80a64135952272f0d607fa5b93f49bf5bd799d Mon Sep 17 00:00:00 2001 From: CalebBarnes Date: Tue, 10 Jun 2025 09:56:50 -0700 Subject: [PATCH 1/2] fix: update getAccount response type from array to single account object The getAccount endpoint was incorrectly documented as returning an array of accountMembership objects, but it actually returns a single accountMembership object. This change updates the OpenAPI specification to correctly reflect the actual API behavior. This fix ensures consistency with other similar single-object endpoints like createAccount, updateAccount, and getCurrentUser. Fixes #567 --- swagger.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/swagger.yml b/swagger.yml index 3bf05e7f..9c4d42da 100644 --- a/swagger.yml +++ b/swagger.yml @@ -2054,9 +2054,7 @@ paths: '200': description: OK schema: - type: array - items: - $ref: '#/definitions/accountMembership' + $ref: '#/definitions/accountMembership' default: $ref: '#/responses/error' put: From 38a673983624263d1ce70b97bf69b32c8a2bfafb Mon Sep 17 00:00:00 2001 From: CalebBarnes Date: Tue, 10 Jun 2025 10:06:05 -0700 Subject: [PATCH 2/2] chore: regenerate Go client for getAccount response type fix Updates the generated Go client code to reflect the corrected getAccount response type. The endpoint now properly returns a single AccountMembership object instead of an array, fixing the generated client types. --- go/plumbing/operations/get_account_responses.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/go/plumbing/operations/get_account_responses.go b/go/plumbing/operations/get_account_responses.go index 6d4b542e..1ba73d65 100644 --- a/go/plumbing/operations/get_account_responses.go +++ b/go/plumbing/operations/get_account_responses.go @@ -52,21 +52,23 @@ GetAccountOK handles this case with default header values. OK */ type GetAccountOK struct { - Payload []*models.AccountMembership + Payload *models.AccountMembership } func (o *GetAccountOK) Error() string { return fmt.Sprintf("[GET /accounts/{account_id}][%d] getAccountOK %+v", 200, o.Payload) } -func (o *GetAccountOK) GetPayload() []*models.AccountMembership { +func (o *GetAccountOK) GetPayload() *models.AccountMembership { return o.Payload } func (o *GetAccountOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.AccountMembership) + // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err }