[Schema Inaccuracy] head.label and head.user can be null in pull-request schema

Open Beginner friendly
#5,562 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
github, openapi
Domain
api, documentation

Research direction

Start at #/components/schemas/pull-request and inspect the definitions of head.label and head.user, using the reported curl response for pull request 51976 as the failing example. Mark both properties nullable and document the nullability conditions, while preserving the existing handling for head.repo; verify the generated schema reflects these changes.

Written by the indexing model from the issue text.

Description

feature

Schema Inaccuracy
The current schema for #/components/schemas/pull-request defines head.label and head.user as required.

Expected
head.label and head.user should have nullable: true with the nullability conditions documented (from what I understand, if the user's account was deleted for some reason: all the cases I can see are for "ghost" users)

Reproduction Steps
❯ curl -s https://api.github.com/repos/odoo/odoo/pulls/51976 | jq .head
{
"label": null,
"ref": "12.0",
"sha": "3cf7aba2e293417c6e8a6a4785624c8315ccbb7a",
"user": null,
"repo": null
}
Side-note
The same issue was fixed for head.repo as reported in https://github.com/github/rest-api-description/issues/161 and https://github.com/github/rest-api-description/issues/424, would be nice to also add a description to that property explaining the conditions under which it can be null.

Dominant language
No language data
Stars
1.6k
Forks
342
Avg merge
3h 33m
Merged PRs (30d)
51

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/rest-api-description

All issues in github/rest-api-description

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.