Skip to content

Commit e7d200c

Browse files
yanyongyuzegl
authored andcommitted
🐛 fix org company and email can be null (yanyongyu#32)
1 parent 8b366e4 commit e7d200c

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

githubkit/rest/models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2621,10 +2621,10 @@ class OrganizationFull(GitHubRestModel):
26212621
avatar_url: str = Field(default=...)
26222622
description: Union[str, None] = Field(default=...)
26232623
name: Missing[str] = Field(default=UNSET)
2624-
company: Missing[str] = Field(default=UNSET)
2624+
company: Missing[Union[str, None]] = Field(default=UNSET)
26252625
blog: Missing[str] = Field(default=UNSET)
26262626
location: Missing[str] = Field(default=UNSET)
2627-
email: Missing[str] = Field(default=UNSET)
2627+
email: Missing[Union[str, None]] = Field(default=UNSET)
26282628
twitter_username: Missing[Union[str, None]] = Field(default=UNSET)
26292629
is_verified: Missing[bool] = Field(default=UNSET)
26302630
has_organization_projects: bool = Field(default=...)
@@ -4281,10 +4281,10 @@ class TeamOrganization(GitHubRestModel):
42814281
avatar_url: str = Field(default=...)
42824282
description: Union[str, None] = Field(default=...)
42834283
name: Missing[str] = Field(default=UNSET)
4284-
company: Missing[str] = Field(default=UNSET)
4284+
company: Missing[Union[str, None]] = Field(default=UNSET)
42854285
blog: Missing[str] = Field(default=UNSET)
42864286
location: Missing[str] = Field(default=UNSET)
4287-
email: Missing[str] = Field(default=UNSET)
4287+
email: Missing[Union[str, None]] = Field(default=UNSET)
42884288
twitter_username: Missing[Union[str, None]] = Field(default=UNSET)
42894289
is_verified: Missing[bool] = Field(default=UNSET)
42904290
has_organization_projects: bool = Field(default=...)

githubkit/rest/types.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1842,10 +1842,10 @@ class OrganizationFullType(TypedDict):
18421842
avatar_url: str
18431843
description: Union[str, None]
18441844
name: NotRequired[str]
1845-
company: NotRequired[str]
1845+
company: NotRequired[Union[str, None]]
18461846
blog: NotRequired[str]
18471847
location: NotRequired[str]
1848-
email: NotRequired[str]
1848+
email: NotRequired[Union[str, None]]
18491849
twitter_username: NotRequired[Union[str, None]]
18501850
is_verified: NotRequired[bool]
18511851
has_organization_projects: bool
@@ -2950,10 +2950,10 @@ class TeamOrganizationType(TypedDict):
29502950
avatar_url: str
29512951
description: Union[str, None]
29522952
name: NotRequired[str]
2953-
company: NotRequired[str]
2953+
company: NotRequired[Union[str, None]]
29542954
blog: NotRequired[str]
29552955
location: NotRequired[str]
2956-
email: NotRequired[str]
2956+
email: NotRequired[Union[str, None]]
29572957
twitter_username: NotRequired[Union[str, None]]
29582958
is_verified: NotRequired[bool]
29592959
has_organization_projects: bool

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ output_dir = "githubkit/rest/"
118118
"/paths/~1repos~1{owner}~1{repo}~1releases/post/requestBody/content/application~1json/schema/properties/make_latest" = { default = "true" }
119119
"/paths/~1repos~1{owner}~1{repo}~1releases~1{release_id}/patch/requestBody/content/application~1json/schema/properties/make_latest" = { default = "true" }
120120

121+
# https://github.com/github/rest-api-description/issues/2507
122+
"/components/schemas/organization-full/properties/company" = { type = ["string", "null"] }
123+
"/components/schemas/organization-full/properties/email" = { type = ["string", "null"] }
124+
"/components/schemas/team-organization/properties/company" = { type = ["string", "null"] }
125+
"/components/schemas/team-organization/properties/email" = { type = ["string", "null"] }
126+
121127
[tool.codegen.webhook]
122128
schema_source = "https://unpkg.com/@octokit/webhooks-schemas/schema.json"
123129
output = "githubkit/webhooks/models.py"

0 commit comments

Comments
 (0)