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 Simple Head repo label field may be null #1811

Open
yanyongyu opened this issue Nov 4, 2022 · 1 comment

Comments

@yanyongyu
Copy link

yanyongyu commented Nov 4, 2022

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 apache/pulsar#6036 which head repo was deleted

Related to yanyongyu/githubkit#6

@yanyongyu
Copy link
Author

yanyongyu commented Dec 19, 2023

The label field can also be null if the branch is deleted according to yanyongyu/githubkit#56

@yanyongyu yanyongyu changed the title [Schema Inaccuracy] Pull Request Simple head.repo object may be null [Schema Inaccuracy] Pull Request Simple Head repo label user field may be null Dec 19, 2023
@yanyongyu yanyongyu changed the title [Schema Inaccuracy] Pull Request Simple Head repo label user field may be null [Schema Inaccuracy] Pull Request Simple Head repo label field may be null Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant