Skip to content
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

[Schema Inaccuracy] the /repos/{owner}/{repo}/releases/latest endpoint can return a 404 #3726

Open
ae-ou opened this issue Jul 6, 2024 · 1 comment

Comments

@ae-ou
Copy link

ae-ou commented Jul 6, 2024

Schema Inaccuracy

The /repos/{owner}/{repo}/releases/latest endpoint returns a 404 if you call it against a repository that has no releases (e.g. a newly created repo). The documentation for this endpoint only lists 200 as a potential response code.

This data block is also returned in the event of a 404:

{
    message: 'Not Found',
    documentation_url: 'https://docs.github.com/rest/releases/releases#get-the-latest-release',
    status: '404'
}

It's worth noting that the page that the documentation_url points to doesn't mention 404 response codes.

Expected

The documentation should list 404 as a possible response code.

Reproduction Steps

  1. Find a repo that has no releases against it, or create a brand new repo for the sake of testing.
  2. Call the endpoint (populate the owner and repo path placeholders, and pass in an API token if the repo is private).
  3. Observe that a 404 response is returned.
@shiftkey
Copy link
Member

shiftkey commented Jul 8, 2024

@ae-ou thanks for the report! I've reached out to the team who maintains that API to confirm this is behaviour that should be documented.

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