Skip to content

[Schema Inaccuracy] Example response for /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} is incorrect #621

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
ams11 opened this issue Oct 12, 2021 · 0 comments

Comments

@ams11
Copy link

ams11 commented Oct 12, 2021

Schema Inaccuracy

Looking at https://docs.github.com/en/rest/reference/teams#check-team-permissions-for-a-repository, I believe some of the fields we include in the Alternative response with repository permissions section are incorrect. Specifically, the following fields are not actually returned by the end point:

  • template_repository (even if the repository was created from a template)
  • allow_rebase_merge
  • allow_squash_merge
  • allow_auto_merge
  • delete_branch_on_merge
  • allow_merge_commit
  • temp_clone_token

I have not reviewed if there are other fields here that also should not be included in the example, nor if there's documentation for other endpoints that also incorrectly includes these fields.

Expected

None of the fields ☝️ shown in the example

Reproduction Steps

GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}

where a team has been granted access to a repository repo, which belongs to the organization org (also referenced as owner ☝️)

In the code, this end point uses the simple_repository_hash methods to include the repository info in the response. The API can return template repository info in a repository response, but it's generated in the code by the full_repository_hash method. Similarly, the merge options are only included if we pass in the show_merge_settings flag, and temp_clone_token only with the generate_temp_clone_token flag - neither is used in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants