Skip to content

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

Closed
@KingBain

Description

@KingBain

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=some.user@gmail.com" -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=some.user@gmail.com" -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":"some.user@gmail.com","role":"direct_member"}'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions