Skip to content

[Schema Inaccuracy] Fetching Issues, redirects to Pull Requests instead #3506

Closed

Description

@Jonas56

Schema Inaccuracy

When fetching issues for the rails project using the GitHub API, the html_url provided in the API response incorrectly redirects to a pull request URL rather than the expected issue URL.

Expected

For an issue fetched from the GitHub API, the expected html_url format should directly link to the issue page on GitHub, following the pattern:

Expected URL Format: https://github.com/rails/rails/issues/<issue_id>

The actual URL format in the API response is:

Actual URL Redirect: https://github.com/rails/rails/pull/<issue_id>

Reproduction Steps

  1. Use the GitHub API to fetch issues related to the Rails project (e.g., curl -X GET https://api.github.com/repos/rails/rails/issues).
  2. Inspect the html_url field in the API response for any issue.

Activity

  1. changed the title [-][Schema Inaccuracy] Fetching Rails Issues, redirects to Pull Requests instead[/-] [+][Schema Inaccuracy] Fetching Issues, redirects to Pull Requests instead[/+] on Apr 6, 2024
  2. shiftkey commented on Apr 11, 2024

    @shiftkey
    Member

    @Jonas56 thanks for the feedback! There's a note in the documentation that describes more about this historical context:

    Note: GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the pull_request key. Be aware that the id of a pull request returned from "Issues" endpoints will be an issue id. To find out the pull request id, use the "List pull requests" endpoint.

    Due to compatibility reasons we've had to keep this behaviour around, but there's extra context in there about how to identify these PRs.

  3. Jonas56 commented on Apr 12, 2024

    @Jonas56
    Author

    Thanks for your response.

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

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