Skip to content

Conversation

@CalebBarnes
Copy link
Contributor

@CalebBarnes CalebBarnes commented Jun 10, 2025

Summary

This PR fixes the incorrect response type for the getAccount endpoint in the OpenAPI specification.

Problem

The getAccount endpoint was incorrectly documented as returning an array of accountMembership objects:

schema:
  type: array
  items:
    $ref: '#/definitions/accountMembership'

However, the actual API returns a single accountMembership object, not an array.

Solution

Updated the response schema to correctly reflect a single object:

schema:
  $ref: '#/definitions/accountMembership'

This change brings the getAccount endpoint in line with other similar single-object endpoints like:

  • createAccount
  • updateAccount
  • getCurrentUser

Testing

  • ✅ All existing tests pass
  • ✅ Build process completes successfully
  • ✅ Generated TypeScript types are correct
  • ✅ Documentation builds without errors

Impact

This fix will:

  • Correct the generated TypeScript types (used in the js client @netlify/api)
  • Update the API documentation to reflect actual behavior
  • Prevent confusion for developers using the API

Fixes #567

Before

image

After

image

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
@CalebBarnes CalebBarnes requested review from a team as code owners June 10, 2025 16:57
@netlify
Copy link

netlify bot commented Jun 10, 2025

Deploy Preview for open-api ready!

Name Link
🔨 Latest commit 38a6739
🔍 Latest deploy log https://app.netlify.com/projects/open-api/deploys/684866092ca4460008d4177f
😎 Deploy Preview https://deploy-preview-568--open-api.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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.
@CalebBarnes CalebBarnes changed the title fix: update getAccount response type from array to single account object fix: update getAccount response type from array to single account object Jun 10, 2025
@CalebBarnes CalebBarnes enabled auto-merge (squash) June 10, 2025 18:13
@CalebBarnes CalebBarnes disabled auto-merge June 10, 2025 18:59
@CalebBarnes CalebBarnes merged commit 43ce43f into master Jul 3, 2025
15 checks passed
@CalebBarnes CalebBarnes deleted the fix/getAccount-response-type branch July 3, 2025 17:02
kathmbeck pushed a commit that referenced this pull request Sep 17, 2025
🤖 I have created a release *beep* *boop*
---


##
[2.38.0](v2.37.0...v2.38.0)
(2025-09-16)


### Features

* add documentation for public endpoint /api/v1/ai-gateway/providers
([#573](#573))
([abb2a3c](abb2a3c))


### Bug Fixes

* update `getAccount` response type from array to single account object
([#568](#568))
([43ce43f](43ce43f))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: token-generator-app[bot] <82042599+token-generator-app[bot]@users.noreply.github.com>
Co-authored-by: token-generator-app[bot] <token-generator-app[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix getAccount endpoint response type from array to single account object

3 participants