Skip to content

[Schema Inaccuracy] Schema says array of objects, but response had a null value in the array alongside the objects #4531

Open
@ctsrc

Description

@ctsrc

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.

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