[Schema Inaccuracy] Pull Request Simple Head repo label field may be null

Open
#5,561 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
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
openapi
Domain
api

Research direction

Start by locating the pull-request-simple schema and compare its head.repo definition with the pull-request schema. Reproduce the response using the listed curl endpoint and the pull request whose head repository was deleted. Update the schema so the field accepts a repository or null, then validate the API description.

Written by the indexing model from the issue text.

Description

Schema Inaccuracy
The Pull Request Simple object field head.repo may be null if user has deleted the repo, as the Pull Request object.

schemas:

incorrect

pull-request-simple:
type: object
title: Pull Request Simple
properties:
head:
type: object
properties:
repo:
"$ref": "#/components/schemas/repository"

correct

pull-request:
type: object
title: Pull Request
properties:
...
head:
type: object
properties:
repo:
type:
- object
- 'null'
Expected
change the repo field to oneof repository / type: null

Reproduction Steps
list pull request using curl -X GET https://api.github.com/repos/apache/pulsar/pulls?state=open

get pull request https://github.com/apache/pulsar/pull/6036 which head repo was deleted

Related to https://github.com/yanyongyu/githubkit/issues/6

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.