diff --git a/githubkit/versions/ghec_v2022_11_28/models/group_0020.py b/githubkit/versions/ghec_v2022_11_28/models/group_0020.py index 4db4f77ecc..d2cd51e0bb 100644 --- a/githubkit/versions/ghec_v2022_11_28/models/group_0020.py +++ b/githubkit/versions/ghec_v2022_11_28/models/group_0020.py @@ -35,7 +35,7 @@ class Repository(GitHubModel): license_: Union[None, LicenseSimple] = Field(alias="license") forks: int = Field() permissions: Missing[RepositoryPropPermissions] = Field(default=UNSET) - owner: SimpleUser = Field(title="Simple User", description="A GitHub user.") + owner: Union[None, SimpleUser] = Field() private: bool = Field( default=False, description="Whether the repository is private or public." ) diff --git a/githubkit/versions/ghec_v2022_11_28/types/group_0020.py b/githubkit/versions/ghec_v2022_11_28/types/group_0020.py index 94bb640b49..b20421e03a 100644 --- a/githubkit/versions/ghec_v2022_11_28/types/group_0020.py +++ b/githubkit/versions/ghec_v2022_11_28/types/group_0020.py @@ -30,7 +30,7 @@ class RepositoryType(TypedDict): license_: Union[None, LicenseSimpleType] forks: int permissions: NotRequired[RepositoryPropPermissionsType] - owner: SimpleUserType + owner: Union[None, SimpleUserType] private: bool html_url: str description: Union[str, None] diff --git a/githubkit/versions/v2022_11_28/models/group_0020.py b/githubkit/versions/v2022_11_28/models/group_0020.py index 4db4f77ecc..d2cd51e0bb 100644 --- a/githubkit/versions/v2022_11_28/models/group_0020.py +++ b/githubkit/versions/v2022_11_28/models/group_0020.py @@ -35,7 +35,7 @@ class Repository(GitHubModel): license_: Union[None, LicenseSimple] = Field(alias="license") forks: int = Field() permissions: Missing[RepositoryPropPermissions] = Field(default=UNSET) - owner: SimpleUser = Field(title="Simple User", description="A GitHub user.") + owner: Union[None, SimpleUser] = Field() private: bool = Field( default=False, description="Whether the repository is private or public." ) diff --git a/githubkit/versions/v2022_11_28/types/group_0020.py b/githubkit/versions/v2022_11_28/types/group_0020.py index 94bb640b49..b20421e03a 100644 --- a/githubkit/versions/v2022_11_28/types/group_0020.py +++ b/githubkit/versions/v2022_11_28/types/group_0020.py @@ -30,7 +30,7 @@ class RepositoryType(TypedDict): license_: Union[None, LicenseSimpleType] forks: int permissions: NotRequired[RepositoryPropPermissionsType] - owner: SimpleUserType + owner: Union[None, SimpleUserType] private: bool html_url: str description: Union[str, None] diff --git a/pyproject.toml b/pyproject.toml index 0fbab27974..089a4278f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -293,6 +293,13 @@ source = "https://raw.githubusercontent.com/github/rest-api-description/main/des "null", ] } +# https://github.com/yanyongyu/githubkit/issues/214 +# repo owner account may be deleted, can be null in pull request +"/components/schemas/repository/properties/owner" = { anyOf = [ + { type = "null" }, + { "$ref" = "#/components/schemas/simple-user" }, +], "$ref" = "" } + # https://github.com/github/rest-api-description/issues/2491 "/components/schemas/auto-merge/properties/commit_title" = { type = [ "string",