Skip to content

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

Open
@ae-ou

Description

@ae-ou

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions