From a8bdc2b01bca301c637fdab263c04a569148f485 Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Fri, 4 Nov 2022 18:07:14 +0000 Subject: [PATCH] :bug: fix label description schema incorrect (fix #7) --- codegen/parser/schemas/__init__.py | 2 +- githubkit/rest/models.py | 2 +- githubkit/rest/types.py | 2 +- pyproject.toml | 3 +++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/codegen/parser/schemas/__init__.py b/codegen/parser/schemas/__init__.py index c6a347cd8..9a983bdf8 100644 --- a/codegen/parser/schemas/__init__.py +++ b/codegen/parser/schemas/__init__.py @@ -29,7 +29,7 @@ def parse_schema( data = source.data try: if overrides := get_schema_override(source): - data = merge_dict(data, overrides) + merge_dict(data, overrides) data = parse_obj_as(Union[oas.Reference, oas.Schema], data) except Exception as e: raise TypeError(f"Invalid Schema from {source.uri}") from e diff --git a/githubkit/rest/models.py b/githubkit/rest/models.py index 44b1a9df5..16afada13 100644 --- a/githubkit/rest/models.py +++ b/githubkit/rest/models.py @@ -6569,7 +6569,7 @@ class PullRequestSimplePropLabelsItems(GitHubRestModel): node_id: str = Field(default=...) url: str = Field(default=...) name: str = Field(default=...) - description: str = Field(default=...) + description: Union[str, None] = Field(default=...) color: str = Field(default=...) default: bool = Field(default=...) diff --git a/githubkit/rest/types.py b/githubkit/rest/types.py index e39896e0b..06531e66e 100644 --- a/githubkit/rest/types.py +++ b/githubkit/rest/types.py @@ -4698,7 +4698,7 @@ class PullRequestSimplePropLabelsItemsType(TypedDict): node_id: str url: str name: str - description: str + description: Union[str, None] color: str default: bool diff --git a/pyproject.toml b/pyproject.toml index 1dea34c7a..f9e0edaaa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -107,6 +107,9 @@ webhook-types-output = "githubkit/webhooks/types.py" { "$ref" = "#/components/schemas/repository" } ], "$ref" = {} } +# https://github.com/github/rest-api-description/issues/1812 +"/components/schemas/pull-request-simple/properties/labels/items/properties/description" = { type = ["string", "null"] } + [build-system] requires = ["poetry_core>=1.0.0"]