Skip to content

Commit

Permalink
🐛 Fix: PullRequestSimplePropHead label field can be null (#65)
Browse files Browse the repository at this point in the history
Co-authored-by: Ju4tCode <42488585+yanyongyu@users.noreply.github.com>
  • Loading branch information
schelv and yanyongyu committed Dec 19, 2023
1 parent 348fa20 commit 2e882d0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion githubkit/rest/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8382,7 +8382,7 @@ class PullRequestSimplePropLabelsItems(GitHubRestModel):
class PullRequestSimplePropHead(GitHubRestModel):
"""PullRequestSimplePropHead"""

label: str = Field(default=...)
label: Union[str, None] = Field(default=...)
ref: str = Field(default=...)
repo: Union[None, Repository] = Field(
title="Repository", description="A repository on GitHub.", default=...
Expand Down
2 changes: 1 addition & 1 deletion githubkit/rest/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -5841,7 +5841,7 @@ class PullRequestSimplePropLabelsItemsType(TypedDict):
class PullRequestSimplePropHeadType(TypedDict):
"""PullRequestSimplePropHead"""

label: str
label: Union[str, None]
ref: str
repo: Union[None, RepositoryType]
sha: str
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,14 @@ output_dir = "githubkit/rest/"
"null",
] }


# https://github.com/github/rest-api-description/issues/1811
# https://github.com/yanyongyu/githubkit/issues/56
# https://github.com/yanyongyu/githubkit/issues/64
"/components/schemas/pull-request-simple/properties/head/properties/label" = { type = [
"string",
"null",
] }
"/components/schemas/pull-request-simple/properties/head/properties/repo" = { anyOf = [
{ type = "null" },
{ "$ref" = "#/components/schemas/repository" },
Expand Down

0 comments on commit 2e882d0

Please sign in to comment.