Skip to content
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

[Schema Inaccuracy] Spelling mistake in Organization invitation response #4109

Closed
KingBain opened this issue Oct 26, 2024 · 1 comment
Closed

Comments

@KingBain
Copy link

KingBain commented Oct 26, 2024

Schema Inaccuracy

Noticed an issue with the return response from the API

When inviting an existing member to an organization, github returns an error message with a spelling mistake.

I thought I would flag this to the API team, but i dont think they have a public github repo.

When i run this command

  gh api \
  --method POST \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  /orgs/ORG/invitations \
   -f "[email protected]" -f "role=direct_member"

The return response is

{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "OrganizationInvitation",
      "code": "unprocessable",
      "field": "data",
      "message": "A user with this email addresss is already a part of this organization"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/orgs/members#create-an-organization-invitation",
  "status": "422"
}

There are two many /s/ in the word addresss.

Expected

{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "OrganizationInvitation",
      "code": "unprocessable",
      "field": "data",
      "message": "A user with this email address is already a part of this organization"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/orgs/members#create-an-organization-invitation",
  "status": "422"
}

Reproduction Steps

Invite a user to a github organization.
Complete the invitation process as the user.
Invite the user again using the gh cli or api

  gh api \
  --method POST \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  /orgs/ORG/invitations \
   -f "[email protected]" -f "role=direct_member"

and/or

curl -L \
  -X POST \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer $GITHUB_TOKEN" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/orgs/ORG/invitations \
  -d '{"email":"[email protected]","role":"direct_member"}'
@bearcherian
Copy link
Contributor

Thanks for bringing this to our attention. We've shipped a change to update the spelling.

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

No branches or pull requests

2 participants