diff --git a/codegen/parser/utils.py b/codegen/parser/utils.py index c823dafb0..30d0e8e2c 100644 --- a/codegen/parser/utils.py +++ b/codegen/parser/utils.py @@ -149,6 +149,8 @@ def merge_list(source: "Source", new: list | dict): def merge_inplace(source: "Source", new: Any): if isinstance(new, dict): _handle_copy(source, new) + if not new: + return if isinstance(source.data, dict) and isinstance(new, dict): merge_dict(source, new) diff --git a/githubkit/versions/ghec_v2022_11_28/models/group_1440.py b/githubkit/versions/ghec_v2022_11_28/models/group_1440.py index d9c520300..2ee820051 100644 --- a/githubkit/versions/ghec_v2022_11_28/models/group_1440.py +++ b/githubkit/versions/ghec_v2022_11_28/models/group_1440.py @@ -22,7 +22,7 @@ class ReposOwnerRepoPagesDeploymentsPostBody(GitHubModel): The object used to create GitHub Pages deployment """ - artifact_id: Missing[float] = Field( + artifact_id: Missing[int] = Field( default=UNSET, description="The ID of an artifact that contains the .zip or .tar of static assets to deploy. The artifact belongs to the repository. Either `artifact_id` or `artifact_url` are required.", ) diff --git a/githubkit/versions/ghec_v2022_11_28/rest/repos.py b/githubkit/versions/ghec_v2022_11_28/rest/repos.py index 7c410a44c..f6839f351 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/repos.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/repos.py @@ -17394,7 +17394,7 @@ def create_pages_deployment( data: UnsetType = UNSET, headers: Optional[Mapping[str, str]] = None, stream: bool = False, - artifact_id: Missing[float] = UNSET, + artifact_id: Missing[int] = UNSET, artifact_url: Missing[str] = UNSET, environment: Missing[str] = UNSET, pages_build_version: str = "GITHUB_SHA", @@ -17476,7 +17476,7 @@ async def async_create_pages_deployment( data: UnsetType = UNSET, headers: Optional[Mapping[str, str]] = None, stream: bool = False, - artifact_id: Missing[float] = UNSET, + artifact_id: Missing[int] = UNSET, artifact_url: Missing[str] = UNSET, environment: Missing[str] = UNSET, pages_build_version: str = "GITHUB_SHA", diff --git a/githubkit/versions/ghec_v2022_11_28/types/group_1440.py b/githubkit/versions/ghec_v2022_11_28/types/group_1440.py index 24214b46b..b334c747e 100644 --- a/githubkit/versions/ghec_v2022_11_28/types/group_1440.py +++ b/githubkit/versions/ghec_v2022_11_28/types/group_1440.py @@ -18,7 +18,7 @@ class ReposOwnerRepoPagesDeploymentsPostBodyType(TypedDict): The object used to create GitHub Pages deployment """ - artifact_id: NotRequired[float] + artifact_id: NotRequired[int] artifact_url: NotRequired[str] environment: NotRequired[str] pages_build_version: str @@ -31,7 +31,7 @@ class ReposOwnerRepoPagesDeploymentsPostBodyTypeForResponse(TypedDict): The object used to create GitHub Pages deployment """ - artifact_id: NotRequired[float] + artifact_id: NotRequired[int] artifact_url: NotRequired[str] environment: NotRequired[str] pages_build_version: str diff --git a/githubkit/versions/ghec_v2026_03_10/models/group_1437.py b/githubkit/versions/ghec_v2026_03_10/models/group_1437.py index d9c520300..2ee820051 100644 --- a/githubkit/versions/ghec_v2026_03_10/models/group_1437.py +++ b/githubkit/versions/ghec_v2026_03_10/models/group_1437.py @@ -22,7 +22,7 @@ class ReposOwnerRepoPagesDeploymentsPostBody(GitHubModel): The object used to create GitHub Pages deployment """ - artifact_id: Missing[float] = Field( + artifact_id: Missing[int] = Field( default=UNSET, description="The ID of an artifact that contains the .zip or .tar of static assets to deploy. The artifact belongs to the repository. Either `artifact_id` or `artifact_url` are required.", ) diff --git a/githubkit/versions/ghec_v2026_03_10/rest/repos.py b/githubkit/versions/ghec_v2026_03_10/rest/repos.py index b133fc4ad..77b877260 100644 --- a/githubkit/versions/ghec_v2026_03_10/rest/repos.py +++ b/githubkit/versions/ghec_v2026_03_10/rest/repos.py @@ -17396,7 +17396,7 @@ def create_pages_deployment( data: UnsetType = UNSET, headers: Optional[Mapping[str, str]] = None, stream: bool = False, - artifact_id: Missing[float] = UNSET, + artifact_id: Missing[int] = UNSET, artifact_url: Missing[str] = UNSET, environment: Missing[str] = UNSET, pages_build_version: str = "GITHUB_SHA", @@ -17478,7 +17478,7 @@ async def async_create_pages_deployment( data: UnsetType = UNSET, headers: Optional[Mapping[str, str]] = None, stream: bool = False, - artifact_id: Missing[float] = UNSET, + artifact_id: Missing[int] = UNSET, artifact_url: Missing[str] = UNSET, environment: Missing[str] = UNSET, pages_build_version: str = "GITHUB_SHA", diff --git a/githubkit/versions/ghec_v2026_03_10/types/group_1437.py b/githubkit/versions/ghec_v2026_03_10/types/group_1437.py index 24214b46b..b334c747e 100644 --- a/githubkit/versions/ghec_v2026_03_10/types/group_1437.py +++ b/githubkit/versions/ghec_v2026_03_10/types/group_1437.py @@ -18,7 +18,7 @@ class ReposOwnerRepoPagesDeploymentsPostBodyType(TypedDict): The object used to create GitHub Pages deployment """ - artifact_id: NotRequired[float] + artifact_id: NotRequired[int] artifact_url: NotRequired[str] environment: NotRequired[str] pages_build_version: str @@ -31,7 +31,7 @@ class ReposOwnerRepoPagesDeploymentsPostBodyTypeForResponse(TypedDict): The object used to create GitHub Pages deployment """ - artifact_id: NotRequired[float] + artifact_id: NotRequired[int] artifact_url: NotRequired[str] environment: NotRequired[str] pages_build_version: str diff --git a/githubkit/versions/v2022_11_28/models/group_1264.py b/githubkit/versions/v2022_11_28/models/group_1264.py index d9c520300..2ee820051 100644 --- a/githubkit/versions/v2022_11_28/models/group_1264.py +++ b/githubkit/versions/v2022_11_28/models/group_1264.py @@ -22,7 +22,7 @@ class ReposOwnerRepoPagesDeploymentsPostBody(GitHubModel): The object used to create GitHub Pages deployment """ - artifact_id: Missing[float] = Field( + artifact_id: Missing[int] = Field( default=UNSET, description="The ID of an artifact that contains the .zip or .tar of static assets to deploy. The artifact belongs to the repository. Either `artifact_id` or `artifact_url` are required.", ) diff --git a/githubkit/versions/v2022_11_28/rest/repos.py b/githubkit/versions/v2022_11_28/rest/repos.py index 48cd351e1..8a14fc901 100644 --- a/githubkit/versions/v2022_11_28/rest/repos.py +++ b/githubkit/versions/v2022_11_28/rest/repos.py @@ -16420,7 +16420,7 @@ def create_pages_deployment( data: UnsetType = UNSET, headers: Optional[Mapping[str, str]] = None, stream: bool = False, - artifact_id: Missing[float] = UNSET, + artifact_id: Missing[int] = UNSET, artifact_url: Missing[str] = UNSET, environment: Missing[str] = UNSET, pages_build_version: str = "GITHUB_SHA", @@ -16502,7 +16502,7 @@ async def async_create_pages_deployment( data: UnsetType = UNSET, headers: Optional[Mapping[str, str]] = None, stream: bool = False, - artifact_id: Missing[float] = UNSET, + artifact_id: Missing[int] = UNSET, artifact_url: Missing[str] = UNSET, environment: Missing[str] = UNSET, pages_build_version: str = "GITHUB_SHA", diff --git a/githubkit/versions/v2022_11_28/types/group_1264.py b/githubkit/versions/v2022_11_28/types/group_1264.py index 24214b46b..b334c747e 100644 --- a/githubkit/versions/v2022_11_28/types/group_1264.py +++ b/githubkit/versions/v2022_11_28/types/group_1264.py @@ -18,7 +18,7 @@ class ReposOwnerRepoPagesDeploymentsPostBodyType(TypedDict): The object used to create GitHub Pages deployment """ - artifact_id: NotRequired[float] + artifact_id: NotRequired[int] artifact_url: NotRequired[str] environment: NotRequired[str] pages_build_version: str @@ -31,7 +31,7 @@ class ReposOwnerRepoPagesDeploymentsPostBodyTypeForResponse(TypedDict): The object used to create GitHub Pages deployment """ - artifact_id: NotRequired[float] + artifact_id: NotRequired[int] artifact_url: NotRequired[str] environment: NotRequired[str] pages_build_version: str diff --git a/githubkit/versions/v2026_03_10/models/group_1263.py b/githubkit/versions/v2026_03_10/models/group_1263.py index d9c520300..2ee820051 100644 --- a/githubkit/versions/v2026_03_10/models/group_1263.py +++ b/githubkit/versions/v2026_03_10/models/group_1263.py @@ -22,7 +22,7 @@ class ReposOwnerRepoPagesDeploymentsPostBody(GitHubModel): The object used to create GitHub Pages deployment """ - artifact_id: Missing[float] = Field( + artifact_id: Missing[int] = Field( default=UNSET, description="The ID of an artifact that contains the .zip or .tar of static assets to deploy. The artifact belongs to the repository. Either `artifact_id` or `artifact_url` are required.", ) diff --git a/githubkit/versions/v2026_03_10/rest/repos.py b/githubkit/versions/v2026_03_10/rest/repos.py index cecf549d1..a18882fa4 100644 --- a/githubkit/versions/v2026_03_10/rest/repos.py +++ b/githubkit/versions/v2026_03_10/rest/repos.py @@ -16422,7 +16422,7 @@ def create_pages_deployment( data: UnsetType = UNSET, headers: Optional[Mapping[str, str]] = None, stream: bool = False, - artifact_id: Missing[float] = UNSET, + artifact_id: Missing[int] = UNSET, artifact_url: Missing[str] = UNSET, environment: Missing[str] = UNSET, pages_build_version: str = "GITHUB_SHA", @@ -16504,7 +16504,7 @@ async def async_create_pages_deployment( data: UnsetType = UNSET, headers: Optional[Mapping[str, str]] = None, stream: bool = False, - artifact_id: Missing[float] = UNSET, + artifact_id: Missing[int] = UNSET, artifact_url: Missing[str] = UNSET, environment: Missing[str] = UNSET, pages_build_version: str = "GITHUB_SHA", diff --git a/githubkit/versions/v2026_03_10/types/group_1263.py b/githubkit/versions/v2026_03_10/types/group_1263.py index 24214b46b..b334c747e 100644 --- a/githubkit/versions/v2026_03_10/types/group_1263.py +++ b/githubkit/versions/v2026_03_10/types/group_1263.py @@ -18,7 +18,7 @@ class ReposOwnerRepoPagesDeploymentsPostBodyType(TypedDict): The object used to create GitHub Pages deployment """ - artifact_id: NotRequired[float] + artifact_id: NotRequired[int] artifact_url: NotRequired[str] environment: NotRequired[str] pages_build_version: str @@ -31,7 +31,7 @@ class ReposOwnerRepoPagesDeploymentsPostBodyTypeForResponse(TypedDict): The object used to create GitHub Pages deployment """ - artifact_id: NotRequired[float] + artifact_id: NotRequired[int] artifact_url: NotRequired[str] environment: NotRequired[str] pages_build_version: str diff --git a/githubkit/versions/versions.lock b/githubkit/versions/versions.lock index 9daccce0e..2887f2fc5 100644 --- a/githubkit/versions/versions.lock +++ b/githubkit/versions/versions.lock @@ -93,6 +93,7 @@ source = "https://raw.githubusercontent.com/github/rest-api-description/d3a3c2a5 "/components/schemas/team-organization/properties/name" = {type = ["string", "null"]} "/components/schemas/team-organization/properties/blog" = {type = ["string", "null"]} "/components/schemas/pages-deployment-status/properties/status/enum" = {"" = ["deployment_queued"]} +"/paths/~1repos~1{owner}~1{repo}~1pages~1deployments/post/requestBody/content/application~1json/schema/properties/artifact_id/type" = {"" = "#/components/parameters/artifact-id/schema/type"} "/components/schemas/git-user/properties/date" = {format = "date-time"} "/components/schemas/verification/required" = {"" = ["verified_at"]} "/components/schemas/diff-entry/properties/blob_url" = {type = ["string", "null"]} diff --git a/pyproject.toml b/pyproject.toml index 9b9e0599d..caf5f5409 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -394,6 +394,9 @@ source = "descriptions-next/ghec/ghec.2026-03-10.json" "deployment_queued", ] } +# https://github.com/yanyongyu/githubkit/issues/300 +"/paths/~1repos~1{owner}~1{repo}~1pages~1deployments/post/requestBody/content/application~1json/schema/properties/artifact_id/type" = { "" = "#/components/parameters/artifact-id/schema/type" } + # https://github.com/yanyongyu/githubkit/issues/199 # https://github.com/github/rest-api-description/issues/4697 # git user date format should be date-time