-
Notifications
You must be signed in to change notification settings - Fork 65.1k
Closed
Labels
contentThis issue or pull request belongs to the Docs Content teamThis issue or pull request belongs to the Docs Content teamfix-internallyTriggers a workflow to copy the issue internally and close the current issueTriggers a workflow to copy the issue internally and close the current issuerestContent related to rest - overview.Content related to rest - overview.
Description
Code of Conduct
- I have read and agree to the GitHub Docs project's Code of Conduct
What article on docs.github.com is affected?
https://docs.github.com/en/rest/branches/branch-protection?apiVersion=2022-11-28#add-user-access-restrictions
https://docs.github.com/en/rest/branches/branch-protection?apiVersion=2022-11-28#add-team-access-restrictions
https://docs.github.com/en/rest/branches/branch-protection?apiVersion=2022-11-28#add-app-access-restrictions
What changes are you suggesting?
POST /repos/OWNER/REPO/branches/BRANCH/protection/restrictions/[users|teams|apps]
The code examples for the APIs above call for a JSON object
{
"users|teams|apps": [
"name1",
"name2"
]
}
However, we will get error in response
gh: Invalid request.
For 'links/12/schema', {"apps" => ["name1"]} is not an array. (HTTP 422)
"message": "Invalid request.\n\nFor 'links/12/schema', {\"apps\" => [\"name1\"]} is not an array.",
"documentation_url": "https://docs.github.com/rest/branches/branch-protection#add-app-access-restrictions",
"status": "422"
}
It turns out that the APIs need an array directly
[
"name1",
"name2"
]
Additional information
No response
Metadata
Metadata
Assignees
Labels
contentThis issue or pull request belongs to the Docs Content teamThis issue or pull request belongs to the Docs Content teamfix-internallyTriggers a workflow to copy the issue internally and close the current issueTriggers a workflow to copy the issue internally and close the current issuerestContent related to rest - overview.Content related to rest - overview.