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] pull-request-review id is int but returns int64 #3795

Closed
gavinbarron opened this issue Jul 29, 2024 · 2 comments
Closed

Comments

@gavinbarron
Copy link

Schema Inaccuracy

The id field on the pull-request-review schema is an int but values over 2147483647 are returned via the api
This is causing runtime issues for the generated SDK as noted in this issue octokit/dotnet-sdk#106
here's the object definition from the dereferenced OpenAPI Spec

"/repos/{owner}/{repo}/pulls/{pull_number}/reviews":
    get:
      summary: List reviews for a pull request
      description: |-
        Lists all reviews for a specified pull request. The list of reviews returns in chronological order.

        This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

        - **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
        - **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
        - **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
        - **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
      tags:
      - pulls
      operationId: pulls/list-reviews
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request
      parameters:
      - *229
      - *230
      - *470
      - *18
      - *20
      responses:
        '200':
          description: The list of reviews returns in chronological order.
          content:
            application/json:
              schema:
                type: array
                items: &473
                  title: Pull Request Review
                  description: Pull Request Reviews are reviews on pull requests.
                  type: object
                  properties:
                    id:
                      description: Unique identifier of the review
                      example: 42
                      type: integer
                    node_id:
                      type: string
                      example: MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=

Expected

The id property should specify the int64 format

                    id:
                      description: Unique identifier of the review
                      example: 42
                      type: integer
                      format: int64

Reproduction Steps

curl --request GET --url 'https://api.github.com/repos/microsoft/kiota/pulls/4602/reviews?page=2'

yeilds this JSON

[
	{
		"id": 2147902723,
		"node_id": "PRR_kwDOE0q91s6ABmUD",
		"user": {
			"login": "andrueastman",
			"id": 6464005,
			"node_id": "MDQ6VXNlcjY0NjQwMDU=",
			"avatar_url": "https://avatars.githubusercontent.com/u/6464005?u=3bf69774d9899535117f1bbebf1557be703fde1a&v=4",
			"gravatar_id": "",
			"url": "https://api.github.com/users/andrueastman",
			"html_url": "https://github.com/andrueastman",
			"followers_url": "https://api.github.com/users/andrueastman/followers",
			"following_url": "https://api.github.com/users/andrueastman/following{/other_user}",
			"gists_url": "https://api.github.com/users/andrueastman/gists{/gist_id}",
			"starred_url": "https://api.github.com/users/andrueastman/starred{/owner}{/repo}",
			"subscriptions_url": "https://api.github.com/users/andrueastman/subscriptions",
			"organizations_url": "https://api.github.com/users/andrueastman/orgs",
			"repos_url": "https://api.github.com/users/andrueastman/repos",
			"events_url": "https://api.github.com/users/andrueastman/events{/privacy}",
			"received_events_url": "https://api.github.com/users/andrueastman/received_events",
			"type": "User",
			"site_admin": false
		},

Here we can see that the id will cause an overflow of a 32-bit integer

@shiftkey
Copy link
Member

@gavinbarron thanks for the report! I've reached out the team that owns this API to see if we can resolve this.

@kfcampbell
Copy link
Member

Thank you for reporting! This was fixed yesterday (I think it was part of #3811, though the web UI is reluctant to show me) and validated in downstream SDK generation.

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

3 participants