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] Schema says array of objects, but response had a null value in the array alongside the objects #4531

Open
ctsrc opened this issue Feb 13, 2025 · 1 comment

Comments

@ctsrc
Copy link

ctsrc commented Feb 13, 2025

Schema Inaccuracy

https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#list-public-repositories

The List Public Repositories endpoint is supposed to return an array of minimal repository objects.

One of the values in such a response at a certain offset was null instead of a minimal repository object.

Expected

Schema should specify that array may contain null values and minimal repository objects, rather than only saying that it contains minimal repository objects.

Reproduction Steps

curl -i "https://api.github.com/repositories?since=263175046"

HTTP/1.1 200 OK
Date: Thu, 13 Feb 2025 06:21:57 GMT
Content-Type: application/json; charset=utf-8
Cache-Control: public, max-age=60, s-maxage=60
Vary: Accept,Accept-Encoding, Accept, X-Requested-With
ETag: W/"94f54685d2f34d4b33402468be31a060f63dbbe9842c0d0294064dc2805f8454"
X-GitHub-Media-Type: github.v3; format=json
Link: <https://api.github.com/repositories?since=263175278>; rel="next", <https://api.github.com/repositories{?since}>; rel="first"
x-github-api-version-selected: 2022-11-28
# …
X-GitHub-Request-Id: D170:2F4C71:38ABFF0:3A8CE3C:67AD8F86
[
  {
    "id": 263175047,
    "node_id": "MDEwOlJlcG9zaXRvcnkyNjMxNzUwNDc=",
    "name": "design-patterns-php",
    "full_name": "ninja-tn/design-patterns-php",
    "private": false,
    #
    "deployments_url": "https://api.github.com/repos/ninja-tn/design-patterns-php/deployments"
  },
  #
  # many lines more, omitted for brevity
  #
  {
    "id": 263175062,
    "node_id": "MDEwOlJlcG9zaXRvcnkyNjMxNzUwNjI=",
    "name": "38671075_60",
    "full_name": "offlinesite/38671075_60",
    "private": false,
    #
    "deployments_url": "https://api.github.com/repos/offlinesite/38671075_60/deployments"
  },
  null,
  {
    "id": 263175064,
    "node_id": "MDEwOlJlcG9zaXRvcnkyNjMxNzUwNjQ=",
    "name": "onLlineBooks",
    "full_name": "crisantus/onLlineBooks",
    "private": false,
    #
    "deployments_url": "https://api.github.com/repos/crisantus/onLlineBooks/deployments"
  }
  #
  # many lines more, omitted for brevity
  #
]

There between object with id 263175062 and object with id 263175064 is a null instead of a minimal repository object.

@ctsrc
Copy link
Author

ctsrc commented Feb 13, 2025

Also note I have included the value of X-GitHub-Request-Id in the above response data for any GitHubbers looking into this.

D170:2F4C71:38ABFF0:3A8CE3C:67AD8F86

@ctsrc ctsrc changed the title [Schema Inaccuracy] Schema says array of objects, but response had a null value [Schema Inaccuracy] Schema says array of objects, but response had a null value in the array alongside the objects Feb 13, 2025
ctsrc added a commit to ctsrc/third-party-api-clients that referenced this issue Feb 16, 2025
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