[Schema Inaccuracy] Get Repository Unavailable for Legal Reasons
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- github, openapi
- Domain
- api, documentation
Research direction
Start with the GET /repos/{owner}/{repo} operation and its listed response definitions, then compare them with the gh api --verbose /repositories/239386228 reproduction. Done means the schema describes the 451 status and the response body fields shown in the issue.
Written by the indexing model from the issue text.
Description
Schema Inaccuracy
When retrieving a repository that is unavailable for legal reasons (e.g. a DMCA takedown request), the GitHub API responds with an HTTP status "451 Unavailable For Legal Reasons" and a response body such as:
{
"message": "Repository access blocked",
"block": {
"reason": "dmca",
"created_at": "2021-04-22T17:53:56Z",
"html_url": "https://github.com/github/dmca/blob/master/2021/04/2021-04-20-ultimate-character-controller.md"
}
}
This response code and error body are not described in the schema.
Relevant schema excerpt:
"/repos/{owner}/{repo}":
get:
summary: Get a repository
description: |-
The `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network.
**Note:** In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."
tags:
- repos
operationId: repos/get
externalDocs:
description: API method documentation
url: https://docs.github.com/rest/repos/repos#get-a-repository
parameters:
- "$ref": "#/components/parameters/owner"
- "$ref": "#/components/parameters/repo"
responses:
'200':
description: Response
content:
application/json:
schema:
"$ref": "#/components/schemas/full-repository"
examples:
default-response:
"$ref": "#/components/examples/full-repository-default-response"
'403':
"$ref": "#/components/responses/forbidden"
'404':
"$ref": "#/components/responses/not_found"
'301':
"$ref": "#/components/responses/moved_permanently"
Expected
Expected a 451 response description for "Get a repository".
Reproduction Steps
gh api --verbose /repositories/239386228
- Dominant language
- No language data
- Stars
- 1.6k
- Forks
- 342
- Avg merge
- 2h 23m
- Merged PRs (30d)
- 57
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/rest-api-description
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
github/rest-api-description#7220 ·
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
github/rest-api-description#7201 ·
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
github/rest-api-description#7163 ·
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
github/rest-api-description#7162 ·
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
github/rest-api-description#7135 ·
All issues in github/rest-api-description
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
canonical/paas-charm#368 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
tech debt
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
area:workflow bug ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
fil-donadoni/tolaria#4409 ·
-
status/awaiting_triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100