Skip to content

fix: update getAccount response type from array to single account object #568

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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
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
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