Skip to content

[Schema Inaccuracy] Should GET /user/repos be paginated? #4048

Closed

Description

@tonyarnold

Schema Inaccuracy

GET /user/repos does not include pagination information in the returned header responses, despite taking page/per_page in the query.

Expected

The response should include headers containing the standard set of links to the previous, next, first and last pages.

I've found that if I manually add these to the schema I'm using that this endpoint does return the expected pagination details.

Activity

  1. changed the title [-][Schema Inaccuracy] Should /user/repos be paginated?[/-] [+][Schema Inaccuracy] Should `GET /user/repos` be paginated?[/+] on Oct 7, 2024
  2. calvinchilds commented on Oct 8, 2024

    @calvinchilds

    Thanks for your report @tonyarnold ! Could you clarify what you mean by

    I've found that if I manually add these to the schema I'm using that this endpoint does return the expected pagination details.

    that is, what schema and what did you add to make the pagination details show up when they weren't before?

  3. tonyarnold commented on Oct 8, 2024

    @tonyarnold
    Author

    Hi @calvinchilds - no worries at all!

    I have tried both the JSON and the YAML schema, but I found if I located the section for /user/repos, and added the following under the existing content block, the Link properties come through in the response:

    headers:
        Link: *37
  4. calvinchilds commented on Oct 8, 2024

    @calvinchilds

    Thanks for replying! What are you plugging that schema into i.e. what are you using to call the API, is it a client library, CLI, curl?

  5. tonyarnold commented on Oct 8, 2024

    @tonyarnold
    Author

    I'm generating Swift sources using Apple's Swift OpenAPI Generator, and compiling them into a desktop app that I've been building for monitoring workflow changes on my Mac.

  6. calvinchilds commented on Oct 9, 2024

    @calvinchilds

    I tried this with curl -I "https://api.github.com/user/repos" and found the link header which looked like

    link: <https://api.github.com/user/repos?page=2>; rel="next", <https://api.github.com/user/repos?page=35>; rel="last"

    and did not show up for my other account with few repositories (as the documentation mentions).

    I'm not familiar with Swift OpenAPI Generator - is the purpose of that configuration to allow certain headers through? Does the same thing happen with other GitHub API endpoints?

  7. tonyarnold commented on Oct 9, 2024

    @tonyarnold
    Author

    I tried this with curl -I "https://api.github.com/user/repos" and found the link header […]

    The issue I'm trying to report here is that the Link header is not in the Open API spec that's been published for api.github.com for this endpoint, so it's not being decoded by tooling that uses the spec to generate code around this.

    I'm not familiar with Swift OpenAPI Generator […]

    From the repository:

    "Generate Swift client and server code from an OpenAPI document."

    "Swift OpenAPI Generator is a Swift package plugin that can generate the ceremony code required to make API calls, or implement API servers."

  8. calvinchilds commented on Oct 10, 2024

    @calvinchilds

    Ah I think I get you now. In https://raw.githubusercontent.com/github/rest-api-description/refs/heads/main/descriptions/api.github.com/api.github.com.yaml search for repos/list-for-authenticated-user and the responses section doesn't have

    headers:
        Link:
            "$ref": "#/components/headers/link"
    

    as some others do. I imagine this is the issue - we'll get on this 👍 (and this is something we should more actively check against our API documentation)

  9. tonyarnold commented on Oct 10, 2024

    @tonyarnold
    Author

    That's exactly the issue. Sorry I wasn't able to be clearer in explaining it.

  10. calvinchilds commented on Oct 10, 2024

    @calvinchilds

    No worries, glad we got there in the end 😄

  11. nickfloyd commented on Nov 4, 2025

    @nickfloyd
    Contributor

    Please let us know if this work is still needed. We're trying to follow up on any older issues to make sure they get properly routed.

  12. becco commented on Jan 8, 2026

    @becco
    Contributor

    Closing as stale.

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