Skip to content

Bug: PullRequestSimple.head.repo.owner is None #214

Closed
@eugene-graft

Description

@eugene-graft

Hi,

I think I've found a bug in the schema.

Env

  • python: 3.12
  • githubkit: 0.12.12

Steps to reproduce

from githubkit import GitHub

kit = GitHub()
owner="pandas-dev"
repo="pandas"
page_num = 16
resp = kit.rest.pulls.list(owner=owner, repo=repo, state="all", page=16, per_page=100)
_ = resp.parsed_data

Error

ValidationError: 1 validation error for list[PullRequestSimple]
62.head.repo.owner
  Input should be an object [type=model_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.9/v/model_type

Potential solution

PullRequestSimple.head.repo.owner should probably be of type SimpleUser | None because the Github API returns owner: None for some pull requests.

Could you please take a look? Thank you in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Rest APIbugSomething isn't workingschemaschema related

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions