github / rest-api-description

An OpenAPI description for GitHub's REST API
MIT License
1.38k stars 225 forks source link

[Schema Inaccuracy] "Create an organization repository" `team_id` parameter is not useful and missing information #3689

Open tonglil opened 3 months ago

tonglil commented 3 months ago

Schema Inaccuracy

https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#create-an-organization-repository

The id passed in this field only sets the team with read access.

  1. This information is not documented
  2. This is not useful as one expects the team specified during repo creation would receive admin access, in particular as repos created by GitHub App installations because then the repo is created without any admin access to anyone.
  3. It would be better if the parameter allowed specifying level of access.

Expected

At least document that the field only grants the team_id team read-only access.

Reproduction Steps

  gh api \
    --silent \
    --method POST \
    -H "Accept: application/vnd.github+json" \
    "/orgs/$org/repos" \
    -f name="some-repo" \
    -F team_id="$team_id"