diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 0306b325..26aa0e2c 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -16,6 +16,7 @@ === Bug fixes * fix untagged enum variant ordering: Integer now comes before Number to prevent unreachable deserialization (#991) * generate `Default` impl for structs where all required fields have explicit defaults (#918) +* honour the JSON Schema `required` contract on serialization for fields whose Rust type has an intrinsic default (`Vec`, `HashMap`, `Option`). Previously an empty/`None` required field was silently omitted because `skip_serializing_if` was applied; now `#[serde(default)]` is emitted alone, so deserialize stays lenient (`{}` parses) but serialize always renders the field. **Wire-format change**: payloads that previously omitted empty required fields will now render them as `[]`, `{}`, or `null` * generate `TryFrom` instead of `From` for bounded integer newtypes, enforcing min/max constraints (#986) * render integer `minimum`/`maximum` as integers (not floats) in doc comments (#843) * handle special characters in enum variant names (`=`, `>`, `≥`, etc.) without panicking (#948) diff --git a/typify-impl/src/defaults.rs b/typify-impl/src/defaults.rs index 84de10c1..bf9a154d 100644 --- a/typify-impl/src/defaults.rs +++ b/typify-impl/src/defaults.rs @@ -596,7 +596,7 @@ fn all_props<'a>( if let Some(name) = maybe_name { let required = match &property.state { - StructPropertyState::Required => true, + StructPropertyState::Required | StructPropertyState::RequiredWithDefault => true, StructPropertyState::Optional | StructPropertyState::Default(_) => false, }; diff --git a/typify-impl/src/lib.rs b/typify-impl/src/lib.rs index ca3d3f8e..eaef6bb7 100644 --- a/typify-impl/src/lib.rs +++ b/typify-impl/src/lib.rs @@ -1327,7 +1327,10 @@ impl<'a> TypeStruct<'a> { .map(move |prop| TypeStructPropInfo { name: prop.name.as_str(), description: prop.description.as_deref(), - required: matches!(&prop.state, StructPropertyState::Required), + required: matches!( + &prop.state, + StructPropertyState::Required | StructPropertyState::RequiredWithDefault + ), type_id: prop.type_id.clone(), }) } diff --git a/typify-impl/src/structs.rs b/typify-impl/src/structs.rs index 1fe6b2d6..4a743ebc 100644 --- a/typify-impl/src/structs.rs +++ b/typify-impl/src/structs.rs @@ -134,12 +134,23 @@ impl TypeSpace { let state = if required.contains(prop_name) { // Even required fields may have an explicit default value // specified in the schema. If so, we use it for the Default impl - // and builder pre-population (and also make serde more lenient). - has_default( + // and builder pre-population (and also make deserialization + // more lenient — but NOT serialization, since the schema + // still requires the field on the wire). + match has_default( self, &type_id, metadata.as_ref().and_then(|m| m.default.as_ref()), - ) + ) { + // `Optional` here means an intrinsic-default type + // (Vec, Option, Map, …) with no explicit schema + // default. Promote to RequiredWithDefault so that + // `generate_serde_attr` emits `#[serde(default)]` + // (lenient deserialize) without `skip_serializing_if` + // (serialization always emits the required field). + StructPropertyState::Optional => StructPropertyState::RequiredWithDefault, + other => other, + } } else { // We can use serde's `default` and `skip_serializing_if` // construction for options, arrays, and maps--i.e. properties that @@ -342,6 +353,16 @@ pub(crate) fn generate_serde_attr( } (StructPropertyState::Required, _) => DefaultFunction::None, + + // Required by the schema but with an intrinsic default for the + // Rust type. Emit `#[serde(default)]` so that deserializing a + // JSON object that lacks the field still succeeds (PR #918's + // intent), but DO NOT emit `skip_serializing_if`: the schema + // says the field is required on the wire. + (StructPropertyState::RequiredWithDefault, _) => { + serde_options.push(quote! { default }); + DefaultFunction::Default + } }; let serde = if serde_options.is_empty() { diff --git a/typify-impl/src/type_entry.rs b/typify-impl/src/type_entry.rs index ac831d16..327ab5b4 100644 --- a/typify-impl/src/type_entry.rs +++ b/typify-impl/src/type_entry.rs @@ -223,6 +223,12 @@ pub(crate) enum StructPropertyRename { #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] pub(crate) enum StructPropertyState { Required, + /// Required by the schema, but with an intrinsic default value + /// (e.g. `Vec::new()`, `None`) — emit `#[serde(default)]` so + /// deserializing `{}` succeeds (PR #918), but DON'T emit + /// `skip_serializing_if`: the schema marks the field required, so + /// it must always be present on the wire. + RequiredWithDefault, Optional, Default(WrappedValue), } diff --git a/typify-impl/tests/github.out b/typify-impl/tests/github.out index fcdaf666..6af7b478 100644 --- a/typify-impl/tests/github.out +++ b/typify-impl/tests/github.out @@ -655,7 +655,7 @@ impl ::std::convert::TryFrom<::std::string::String> for AlertInstanceState { #[serde(deny_unknown_fields)] pub struct App { pub created_at: ::chrono::DateTime<::chrono::offset::Utc>, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub description: ::std::option::Option<::std::string::String>, #[doc = "The list of events for the GitHub app"] #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] @@ -4053,7 +4053,7 @@ pub struct BranchProtectionRule { pub admin_enforced: bool, pub allow_deletions_enforcement_level: BranchProtectionRuleAllowDeletionsEnforcementLevel, pub allow_force_pushes_enforcement_level: BranchProtectionRuleAllowForcePushesEnforcementLevel, - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub authorized_actor_names: ::std::vec::Vec<::std::string::String>, pub authorized_actors_only: bool, pub authorized_dismissal_actors_only: bool, @@ -4074,7 +4074,7 @@ pub struct BranchProtectionRule { BranchProtectionRuleRequiredConversationResolutionLevel, pub required_deployments_enforcement_level: BranchProtectionRuleRequiredDeploymentsEnforcementLevel, - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub required_status_checks: ::std::vec::Vec<::std::string::String>, pub required_status_checks_enforcement_level: BranchProtectionRuleRequiredStatusChecksEnforcementLevel, @@ -4731,7 +4731,7 @@ impl ::std::default::Default for BranchProtectionRuleEditedChanges { #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)] #[serde(deny_unknown_fields)] pub struct BranchProtectionRuleEditedChangesAuthorizedActorNames { - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub from: ::std::vec::Vec<::std::string::String>, } impl ::std::default::Default for BranchProtectionRuleEditedChangesAuthorizedActorNames { @@ -5986,7 +5986,7 @@ pub struct CheckRunCompletedCheckRun { #[doc = "The time the check completed. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`."] pub completed_at: ::std::string::String, #[doc = "The result of the completed check run. Can be one of `success`, `failure`, `neutral`, `cancelled`, `timed_out`, `action_required` or `stale`. This value will be `null` until the check run has completed."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub conclusion: ::std::option::Option, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub details_url: ::std::option::Option<::std::string::String>, @@ -6001,7 +6001,7 @@ pub struct CheckRunCompletedCheckRun { #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub node_id: ::std::option::Option<::std::string::String>, pub output: CheckRunCompletedCheckRunOutput, - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub pull_requests: ::std::vec::Vec, #[doc = "The time that the check run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`."] pub started_at: ::std::string::String, @@ -6117,17 +6117,17 @@ pub struct CheckRunCompletedCheckRun { #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)] #[serde(deny_unknown_fields)] pub struct CheckRunCompletedCheckRunCheckSuite { - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub after: ::std::option::Option<::std::string::String>, pub app: App, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub before: ::std::option::Option<::std::string::String>, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub conclusion: ::std::option::Option, pub created_at: ::chrono::DateTime<::chrono::offset::Utc>, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub deployment: ::std::option::Option, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub head_branch: ::std::option::Option<::std::string::String>, #[doc = "The SHA of the head commit that is being checked."] pub head_sha: ::std::string::String, @@ -6136,7 +6136,7 @@ pub struct CheckRunCompletedCheckRunCheckSuite { #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub node_id: ::std::option::Option<::std::string::String>, #[doc = "An array of pull requests that match this check suite. A pull request matches a check suite if they have the same `head_sha` and `head_branch`. When the check suite's `head_branch` is in a forked repository it will be `null` and the `pull_requests` array will be empty."] - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub pull_requests: ::std::vec::Vec, pub status: CheckRunCompletedCheckRunCheckSuiteStatus, pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>, @@ -6472,9 +6472,9 @@ impl ::std::convert::TryFrom<::std::string::String> for CheckRunCompletedCheckRu pub struct CheckRunCompletedCheckRunOutput { pub annotations_count: i64, pub annotations_url: ::std::string::String, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub summary: ::std::option::Option<::std::string::String>, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub text: ::std::option::Option<::std::string::String>, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub title: ::std::option::Option<::std::string::String>, @@ -7197,10 +7197,10 @@ pub struct CheckRunCreatedCheckRun { pub app: App, pub check_suite: CheckRunCreatedCheckRunCheckSuite, #[doc = "The time the check completed. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub completed_at: ::std::option::Option<::std::string::String>, #[doc = "The result of the completed check run. Can be one of `success`, `failure`, `neutral`, `cancelled`, `timed_out`, `action_required` or `stale`. This value will be `null` until the check run has completed."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub conclusion: ::std::option::Option, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub details_url: ::std::option::Option<::std::string::String>, @@ -7215,7 +7215,7 @@ pub struct CheckRunCreatedCheckRun { #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub node_id: ::std::option::Option<::std::string::String>, pub output: CheckRunCreatedCheckRunOutput, - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub pull_requests: ::std::vec::Vec, #[doc = "The time that the check run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`."] pub started_at: ::std::string::String, @@ -7331,17 +7331,17 @@ pub struct CheckRunCreatedCheckRun { #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)] #[serde(deny_unknown_fields)] pub struct CheckRunCreatedCheckRunCheckSuite { - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub after: ::std::option::Option<::std::string::String>, pub app: App, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub before: ::std::option::Option<::std::string::String>, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub conclusion: ::std::option::Option, pub created_at: ::chrono::DateTime<::chrono::offset::Utc>, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub deployment: ::std::option::Option, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub head_branch: ::std::option::Option<::std::string::String>, #[doc = "The SHA of the head commit that is being checked."] pub head_sha: ::std::string::String, @@ -7350,7 +7350,7 @@ pub struct CheckRunCreatedCheckRunCheckSuite { #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub node_id: ::std::option::Option<::std::string::String>, #[doc = "An array of pull requests that match this check suite. A pull request matches a check suite if they have the same `head_sha` and `head_branch`. When the check suite's `head_branch` is in a forked repository it will be `null` and the `pull_requests` array will be empty."] - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub pull_requests: ::std::vec::Vec, pub status: CheckRunCreatedCheckRunCheckSuiteStatus, pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>, @@ -7686,9 +7686,9 @@ impl ::std::convert::TryFrom<::std::string::String> for CheckRunCreatedCheckRunC pub struct CheckRunCreatedCheckRunOutput { pub annotations_count: i64, pub annotations_url: ::std::string::String, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub summary: ::std::option::Option<::std::string::String>, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub text: ::std::option::Option<::std::string::String>, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub title: ::std::option::Option<::std::string::String>, @@ -7877,7 +7877,7 @@ impl ::std::default::Default for CheckRunCreatedRequestedAction { #[serde(deny_unknown_fields)] pub struct CheckRunDeployment { pub created_at: ::chrono::DateTime<::chrono::offset::Utc>, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub description: ::std::option::Option<::std::string::String>, pub environment: ::std::string::String, pub id: i64, @@ -8705,10 +8705,10 @@ pub struct CheckRunRequestedActionCheckRun { pub app: App, pub check_suite: CheckRunRequestedActionCheckRunCheckSuite, #[doc = "The time the check completed. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub completed_at: ::std::option::Option<::std::string::String>, #[doc = "The result of the completed check run. Can be one of `success`, `failure`, `neutral`, `cancelled`, `timed_out`, `action_required` or `stale`. This value will be `null` until the check run has completed."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub conclusion: ::std::option::Option, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub details_url: ::std::option::Option<::std::string::String>, @@ -8723,7 +8723,7 @@ pub struct CheckRunRequestedActionCheckRun { #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub node_id: ::std::option::Option<::std::string::String>, pub output: CheckRunRequestedActionCheckRunOutput, - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub pull_requests: ::std::vec::Vec, #[doc = "The time that the check run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`."] pub started_at: ::std::string::String, @@ -8839,17 +8839,17 @@ pub struct CheckRunRequestedActionCheckRun { #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)] #[serde(deny_unknown_fields)] pub struct CheckRunRequestedActionCheckRunCheckSuite { - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub after: ::std::option::Option<::std::string::String>, pub app: App, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub before: ::std::option::Option<::std::string::String>, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub conclusion: ::std::option::Option, pub created_at: ::chrono::DateTime<::chrono::offset::Utc>, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub deployment: ::std::option::Option, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub head_branch: ::std::option::Option<::std::string::String>, #[doc = "The SHA of the head commit that is being checked."] pub head_sha: ::std::string::String, @@ -8858,7 +8858,7 @@ pub struct CheckRunRequestedActionCheckRunCheckSuite { #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub node_id: ::std::option::Option<::std::string::String>, #[doc = "An array of pull requests that match this check suite. A pull request matches a check suite if they have the same `head_sha` and `head_branch`. When the check suite's `head_branch` is in a forked repository it will be `null` and the `pull_requests` array will be empty."] - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub pull_requests: ::std::vec::Vec, pub status: CheckRunRequestedActionCheckRunCheckSuiteStatus, pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>, @@ -9198,9 +9198,9 @@ impl ::std::convert::TryFrom<::std::string::String> for CheckRunRequestedActionC pub struct CheckRunRequestedActionCheckRunOutput { pub annotations_count: i64, pub annotations_url: ::std::string::String, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub summary: ::std::option::Option<::std::string::String>, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub text: ::std::option::Option<::std::string::String>, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub title: ::std::option::Option<::std::string::String>, @@ -9913,7 +9913,7 @@ pub struct CheckRunRerequestedCheckRun { #[doc = "The time the check completed. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`."] pub completed_at: ::std::string::String, #[doc = "The result of the completed check run. Can be one of `success`, `failure`, `neutral`, `cancelled`, `timed_out`, `action_required` or `stale`. This value will be `null` until the check run has `completed`."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub conclusion: ::std::option::Option, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub details_url: ::std::option::Option<::std::string::String>, @@ -9928,7 +9928,7 @@ pub struct CheckRunRerequestedCheckRun { #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub node_id: ::std::option::Option<::std::string::String>, pub output: CheckRunRerequestedCheckRunOutput, - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub pull_requests: ::std::vec::Vec, #[doc = "The time that the check run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`."] pub started_at: ::std::string::String, @@ -10038,16 +10038,16 @@ pub struct CheckRunRerequestedCheckRun { #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)] #[serde(deny_unknown_fields)] pub struct CheckRunRerequestedCheckRunCheckSuite { - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub after: ::std::option::Option<::std::string::String>, pub app: App, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub before: ::std::option::Option<::std::string::String>, pub conclusion: CheckRunRerequestedCheckRunCheckSuiteConclusion, pub created_at: ::chrono::DateTime<::chrono::offset::Utc>, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub deployment: ::std::option::Option, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub head_branch: ::std::option::Option<::std::string::String>, #[doc = "The SHA of the head commit that is being checked."] pub head_sha: ::std::string::String, @@ -10056,7 +10056,7 @@ pub struct CheckRunRerequestedCheckRunCheckSuite { #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub node_id: ::std::option::Option<::std::string::String>, #[doc = "An array of pull requests that match this check suite. A pull request matches a check suite if they have the same `head_sha` and `head_branch`. When the check suite's `head_branch` is in a forked repository it will be `null` and the `pull_requests` array will be empty."] - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub pull_requests: ::std::vec::Vec, pub status: CheckRunRerequestedCheckRunCheckSuiteStatus, pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>, @@ -10386,9 +10386,9 @@ impl ::std::convert::TryFrom<::std::string::String> for CheckRunRerequestedCheck pub struct CheckRunRerequestedCheckRunOutput { pub annotations_count: i64, pub annotations_url: ::std::string::String, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub summary: ::std::option::Option<::std::string::String>, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub text: ::std::option::Option<::std::string::String>, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub title: ::std::option::Option<::std::string::String>, @@ -10853,15 +10853,15 @@ impl ::std::convert::TryFrom<::std::string::String> for CheckSuiteCompletedActio pub struct CheckSuiteCompletedCheckSuite { pub after: ::std::string::String, pub app: App, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub before: ::std::option::Option<::std::string::String>, pub check_runs_url: ::std::string::String, #[doc = "The summary conclusion for all check runs that are part of the check suite. Can be one of `success`, `failure`, `neutral`, `cancelled`, `timed_out`, `action_required` or `stale`. This value will be `null` until the check run has `completed`."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub conclusion: ::std::option::Option, pub created_at: ::chrono::DateTime<::chrono::offset::Utc>, #[doc = "The head branch name the changes are on."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub head_branch: ::std::option::Option<::std::string::String>, pub head_commit: CommitSimple, #[doc = "The SHA of the head commit that is being checked."] @@ -10870,10 +10870,10 @@ pub struct CheckSuiteCompletedCheckSuite { pub latest_check_runs_count: i64, pub node_id: ::std::string::String, #[doc = "An array of pull requests that match this check suite. A pull request matches a check suite if they have the same `head_sha` and `head_branch`. When the check suite's `head_branch` is in a forked repository it will be `null` and the `pull_requests` array will be empty."] - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub pull_requests: ::std::vec::Vec, #[doc = "The summary status for all check runs that are part of the check suite. Can be `requested`, `in_progress`, or `completed`."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub status: ::std::option::Option, pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>, #[doc = "URL that points to the check suite API resource."] @@ -11462,15 +11462,15 @@ impl ::std::convert::TryFrom<::std::string::String> for CheckSuiteRequestedActio pub struct CheckSuiteRequestedCheckSuite { pub after: ::std::string::String, pub app: App, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub before: ::std::option::Option<::std::string::String>, pub check_runs_url: ::std::string::String, #[doc = "The summary conclusion for all check runs that are part of the check suite. Can be one of `success`, `failure`,` neutral`, `cancelled`, `timed_out`, `action_required` or `stale`. This value will be `null` until the check run has completed."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub conclusion: ::std::option::Option, pub created_at: ::chrono::DateTime<::chrono::offset::Utc>, #[doc = "The head branch name the changes are on."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub head_branch: ::std::option::Option<::std::string::String>, pub head_commit: CommitSimple, #[doc = "The SHA of the head commit that is being checked."] @@ -11479,10 +11479,10 @@ pub struct CheckSuiteRequestedCheckSuite { pub latest_check_runs_count: i64, pub node_id: ::std::string::String, #[doc = "An array of pull requests that match this check suite. A pull request matches a check suite if they have the same `head_sha` and `head_branch`. When the check suite's `head_branch` is in a forked repository it will be `null` and the `pull_requests` array will be empty."] - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub pull_requests: ::std::vec::Vec, #[doc = "The summary status for all check runs that are part of the check suite. Can be `requested`, `in_progress`, or `completed`."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub status: ::std::option::Option, pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>, #[doc = "URL that points to the check suite API resource."] @@ -12029,15 +12029,15 @@ impl ::std::convert::TryFrom<::std::string::String> for CheckSuiteRerequestedAct pub struct CheckSuiteRerequestedCheckSuite { pub after: ::std::string::String, pub app: App, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub before: ::std::option::Option<::std::string::String>, pub check_runs_url: ::std::string::String, #[doc = "The summary conclusion for all check runs that are part of the check suite. Can be one of `success`, `failure`,` neutral`, `cancelled`, `timed_out`, `action_required` or `stale`. This value will be `null` until the check run has completed."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub conclusion: ::std::option::Option, pub created_at: ::chrono::DateTime<::chrono::offset::Utc>, #[doc = "The head branch name the changes are on."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub head_branch: ::std::option::Option<::std::string::String>, pub head_commit: CommitSimple, #[doc = "The SHA of the head commit that is being checked."] @@ -12046,10 +12046,10 @@ pub struct CheckSuiteRerequestedCheckSuite { pub latest_check_runs_count: i64, pub node_id: ::std::string::String, #[doc = "An array of pull requests that match this check suite. A pull request matches a check suite if they have the same `head_sha` and `head_branch`. When the check suite's `head_branch` is in a forked repository it will be `null` and the `pull_requests` array will be empty."] - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub pull_requests: ::std::vec::Vec, #[doc = "The summary status for all check runs that are part of the check suite. Can be `requested`, `in_progress`, or `completed`."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub status: ::std::option::Option, pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>, #[doc = "URL that points to the check suite API resource."] @@ -12664,17 +12664,17 @@ pub struct CodeScanningAlertAppearedInBranchAlert { #[doc = "The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ.`"] pub created_at: ::chrono::DateTime<::chrono::offset::Utc>, #[doc = "The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub dismissed_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub dismissed_by: ::std::option::Option, #[doc = "The reason for dismissing or closing the alert. Can be one of: `false positive`, `won't fix`, and `used in tests`."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub dismissed_reason: ::std::option::Option, #[doc = "The GitHub URL of the alert resource."] pub html_url: ::std::string::String, - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub instances: ::std::vec::Vec, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub most_recent_instance: ::std::option::Option, @@ -12816,7 +12816,7 @@ pub struct CodeScanningAlertAppearedInBranchAlertRule { #[doc = "A unique identifier for the rule used to detect the alert."] pub id: ::std::string::String, #[doc = "The severity of the alert."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub severity: ::std::option::Option, } #[doc = "The severity of the alert."] @@ -13022,7 +13022,7 @@ pub struct CodeScanningAlertAppearedInBranchAlertTool { #[doc = "The name of the tool used to generate the code scanning analysis alert."] pub name: ::std::string::String, #[doc = "The version of the tool used to detect the alert."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub version: ::std::option::Option<::std::string::String>, } #[doc = "`CodeScanningAlertClosedByUser`"] @@ -13500,11 +13500,11 @@ pub struct CodeScanningAlertClosedByUserAlert { pub dismissed_at: ::chrono::DateTime<::chrono::offset::Utc>, pub dismissed_by: User, #[doc = "The reason for dismissing or closing the alert. Can be one of: `false positive`, `won't fix`, and `used in tests`."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub dismissed_reason: ::std::option::Option, #[doc = "The GitHub URL of the alert resource."] pub html_url: ::std::string::String, - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub instances: ::std::vec::Vec, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub most_recent_instance: ::std::option::Option, @@ -13867,7 +13867,7 @@ pub struct CodeScanningAlertClosedByUserAlertRule { #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub name: ::std::option::Option<::std::string::String>, #[doc = "The severity of the alert."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub severity: ::std::option::Option, #[serde(default)] pub tags: (), @@ -14069,7 +14069,7 @@ pub struct CodeScanningAlertClosedByUserAlertTool { #[doc = "The name of the tool used to generate the code scanning analysis alert."] pub name: ::std::string::String, #[doc = "The version of the tool used to detect the alert."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub version: ::std::option::Option<::std::string::String>, } #[doc = "`CodeScanningAlertCreated`"] @@ -14543,7 +14543,7 @@ pub struct CodeScanningAlertCreatedAlert { pub dismissed_reason: (), #[doc = "The GitHub URL of the alert resource."] pub html_url: ::std::string::String, - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub instances: ::std::vec::Vec, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub most_recent_instance: ::std::option::Option, @@ -14829,7 +14829,7 @@ pub struct CodeScanningAlertCreatedAlertRule { #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub name: ::std::option::Option<::std::string::String>, #[doc = "The severity of the alert."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub severity: ::std::option::Option, #[serde(default)] pub tags: (), @@ -15032,7 +15032,7 @@ pub struct CodeScanningAlertCreatedAlertTool { #[doc = "The name of the tool used to generate the code scanning analysis alert."] pub name: ::std::string::String, #[doc = "The version of the tool used to detect the alert."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub version: ::std::option::Option<::std::string::String>, } #[doc = "`CodeScanningAlertEvent`"] @@ -15610,16 +15610,16 @@ pub struct CodeScanningAlertFixedAlert { #[doc = "The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ.`"] pub created_at: ::chrono::DateTime<::chrono::offset::Utc>, #[doc = "The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub dismissed_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub dismissed_by: ::std::option::Option, #[doc = "The reason for dismissing or closing the alert. Can be one of: `false positive`, `won't fix`, and `used in tests`."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub dismissed_reason: ::std::option::Option, #[doc = "The GitHub URL of the alert resource."] pub html_url: ::std::string::String, - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub instances: ::std::vec::Vec, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub instances_url: ::std::option::Option<::std::string::String>, @@ -15981,7 +15981,7 @@ pub struct CodeScanningAlertFixedAlertRule { #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub name: ::std::option::Option<::std::string::String>, #[doc = "The severity of the alert."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub severity: ::std::option::Option, #[serde(default)] pub tags: (), @@ -16179,7 +16179,7 @@ pub struct CodeScanningAlertFixedAlertTool { #[doc = "The name of the tool used to generate the code scanning analysis alert."] pub name: ::std::string::String, #[doc = "The version of the tool used to detect the alert."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub version: ::std::option::Option<::std::string::String>, } #[doc = "`CodeScanningAlertReopened`"] @@ -16653,7 +16653,7 @@ pub struct CodeScanningAlertReopenedAlert { pub dismissed_reason: (), #[doc = "The GitHub URL of the alert resource."] pub html_url: ::std::string::String, - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub instances: ::std::vec::Vec, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub most_recent_instance: ::std::option::Option, @@ -16933,7 +16933,7 @@ pub struct CodeScanningAlertReopenedAlertRule { #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub name: ::std::option::Option<::std::string::String>, #[doc = "The severity of the alert."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub severity: ::std::option::Option, #[serde(default)] pub tags: (), @@ -17143,7 +17143,7 @@ pub struct CodeScanningAlertReopenedAlertTool { #[doc = "The name of the tool used to generate the code scanning analysis alert."] pub name: ::std::string::String, #[doc = "The version of the tool used to detect the alert."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub version: ::std::option::Option<::std::string::String>, } #[doc = "`CodeScanningAlertReopenedByUser`"] @@ -17577,7 +17577,7 @@ pub struct CodeScanningAlertReopenedByUserAlert { pub dismissed_reason: (), #[doc = "The GitHub URL of the alert resource."] pub html_url: ::std::string::String, - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub instances: ::std::vec::Vec, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub most_recent_instance: ::std::option::Option, @@ -17839,7 +17839,7 @@ pub struct CodeScanningAlertReopenedByUserAlertRule { #[doc = "A unique identifier for the rule used to detect the alert."] pub id: ::std::string::String, #[doc = "The severity of the alert."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub severity: ::std::option::Option, } #[doc = "The severity of the alert."] @@ -18031,7 +18031,7 @@ pub struct CodeScanningAlertReopenedByUserAlertTool { #[doc = "The name of the tool used to generate the code scanning analysis alert."] pub name: ::std::string::String, #[doc = "The version of the tool used to detect the alert."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub version: ::std::option::Option<::std::string::String>, } #[doc = "`Commit`"] @@ -18116,7 +18116,7 @@ pub struct CodeScanningAlertReopenedByUserAlertTool { #[serde(deny_unknown_fields)] pub struct Commit { #[doc = "An array of files added in the commit."] - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub added: ::std::vec::Vec<::std::string::String>, pub author: Committer, pub committer: Committer, @@ -18126,10 +18126,10 @@ pub struct Commit { #[doc = "The commit message."] pub message: ::std::string::String, #[doc = "An array of files modified by the commit."] - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub modified: ::std::vec::Vec<::std::string::String>, #[doc = "An array of files removed in the commit."] - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub removed: ::std::vec::Vec<::std::string::String>, #[doc = "The ISO 8601 timestamp of the commit."] pub timestamp: ::std::string::String, @@ -18437,15 +18437,15 @@ pub struct CommitCommentCreatedComment { #[doc = "The ID of the commit comment."] pub id: i64, #[doc = "The line of the blob to which the comment applies. The last line of the range for a multi-line comment"] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub line: ::std::option::Option, #[doc = "The node ID of the commit comment."] pub node_id: ::std::string::String, #[doc = "The relative path of the file to which the comment applies."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub path: ::std::option::Option<::std::string::String>, #[doc = "The line index in the diff to which the comment applies."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub position: ::std::option::Option, pub updated_at: ::std::string::String, pub url: ::std::string::String, @@ -18584,7 +18584,7 @@ pub struct Committer { #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub date: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>, #[doc = "The git author's email address."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub email: ::std::option::Option<::std::string::String>, #[doc = "The git author's name."] pub name: ::std::string::String, @@ -18866,7 +18866,7 @@ impl ::std::convert::From for ContentReferenceEvent { #[serde(deny_unknown_fields)] pub struct CreateEvent { #[doc = "The repository's current description."] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub description: ::std::option::Option<::std::string::String>, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub installation: ::std::option::Option, @@ -20313,7 +20313,7 @@ pub struct DeploymentStatusCreatedDeployment { pub node_id: ::std::string::String, pub original_environment: ::std::string::String, pub payload: DeploymentStatusCreatedDeploymentPayload, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub performed_via_github_app: ::std::option::Option, #[serde(rename = "ref")] pub ref_: ::std::string::String, @@ -20638,13 +20638,13 @@ impl ::std::convert::From for DeploymentStatusEvent { #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)] #[serde(deny_unknown_fields)] pub struct Discussion { - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub active_lock_reason: ::std::option::Option<::std::string::String>, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub answer_chosen_at: ::std::option::Option<::std::string::String>, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub answer_chosen_by: ::std::option::Option, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub answer_html_url: ::std::option::Option<::std::string::String>, pub author_association: AuthorAssociation, pub body: ::std::string::String, @@ -21022,7 +21022,7 @@ pub struct DiscussionAnsweredAnswer { #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)] #[serde(deny_unknown_fields)] pub struct DiscussionAnsweredDiscussion { - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub active_lock_reason: ::std::option::Option<::std::string::String>, pub answer_chosen_at: ::chrono::DateTime<::chrono::offset::Utc>, pub answer_chosen_by: DiscussionAnsweredDiscussionAnswerChosenBy, @@ -22134,7 +22134,7 @@ pub struct DiscussionCommentCreatedComment { pub html_url: ::std::string::String, pub id: i64, pub node_id: ::std::string::String, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub parent_id: ::std::option::Option, pub repository_url: ::std::string::String, pub updated_at: ::std::string::String, @@ -22399,7 +22399,7 @@ pub struct DiscussionCommentDeletedComment { pub html_url: ::std::string::String, pub id: i64, pub node_id: ::std::string::String, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub parent_id: ::std::option::Option, pub repository_url: ::std::string::String, pub updated_at: ::std::string::String, @@ -22744,7 +22744,7 @@ pub struct DiscussionCommentEditedComment { pub html_url: ::std::string::String, pub id: i64, pub node_id: ::std::string::String, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub parent_id: ::std::option::Option, pub repository_url: ::std::string::String, pub updated_at: ::std::string::String, @@ -23004,7 +23004,7 @@ impl ::std::convert::TryFrom<::std::string::String> for DiscussionCreatedAction #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)] #[serde(deny_unknown_fields)] pub struct DiscussionCreatedDiscussion { - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub active_lock_reason: ::std::option::Option<::std::string::String>, #[serde(default)] pub answer_chosen_at: (), @@ -23984,13 +23984,13 @@ impl ::std::convert::TryFrom<::std::string::String> for DiscussionLockedAction { #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)] #[serde(deny_unknown_fields)] pub struct DiscussionLockedDiscussion { - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub active_lock_reason: ::std::option::Option<::std::string::String>, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub answer_chosen_at: ::std::option::Option<::std::string::String>, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub answer_chosen_by: ::std::option::Option, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub answer_html_url: ::std::option::Option<::std::string::String>, pub author_association: AuthorAssociation, pub body: ::std::string::String, @@ -24780,7 +24780,7 @@ impl ::std::convert::TryFrom<::std::string::String> for DiscussionUnansweredActi #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)] #[serde(deny_unknown_fields)] pub struct DiscussionUnansweredDiscussion { - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub active_lock_reason: ::std::option::Option<::std::string::String>, #[serde(default)] pub answer_chosen_at: (), @@ -25343,13 +25343,13 @@ impl ::std::convert::TryFrom<::std::string::String> for DiscussionUnlockedAction #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)] #[serde(deny_unknown_fields)] pub struct DiscussionUnlockedDiscussion { - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub active_lock_reason: ::std::option::Option<::std::string::String>, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub answer_chosen_at: ::std::option::Option<::std::string::String>, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub answer_chosen_by: ::std::option::Option, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub answer_html_url: ::std::option::Option<::std::string::String>, pub author_association: AuthorAssociation, pub body: ::std::string::String, @@ -26259,7 +26259,7 @@ pub struct ForkEventForkee { #[serde(default)] pub delete_branch_on_merge: bool, pub deployments_url: ::std::string::String, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub description: ::std::option::Option<::std::string::String>, #[doc = "Returns whether or not this repository is disabled."] #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] @@ -26288,7 +26288,7 @@ pub struct ForkEventForkee { #[doc = "Whether the wiki is enabled."] #[serde(default = "defaults::default_bool::")] pub has_wiki: bool, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub homepage: ::std::option::Option<::std::string::String>, pub hooks_url: ::std::string::String, pub html_url: ::std::string::String, @@ -26299,16 +26299,16 @@ pub struct ForkEventForkee { pub issues_url: ::std::string::String, pub keys_url: ::std::string::String, pub labels_url: ::std::string::String, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub language: ::std::option::Option<::std::string::String>, pub languages_url: ::std::string::String, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub license: ::std::option::Option, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub master_branch: ::std::option::Option<::std::string::String>, pub merges_url: ::std::string::String, pub milestones_url: ::std::string::String, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub mirror_url: ::std::option::Option<::std::string::String>, #[doc = "The name of the repository."] pub name: ::std::string::String, @@ -26878,7 +26878,7 @@ pub struct GollumEvent { #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub organization: ::std::option::Option, #[doc = "The pages that were updated."] - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub pages: ::std::vec::Vec, pub repository: Repository, pub sender: User, @@ -27466,7 +27466,7 @@ pub struct Installation { #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub app_slug: ::std::option::Option<::std::string::String>, pub created_at: InstallationCreatedAt, - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub events: ::std::vec::Vec, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub has_multiple_single_files: ::std::option::Option, @@ -27477,13 +27477,13 @@ pub struct Installation { pub repositories_url: ::std::string::String, #[doc = "Describe whether all repositories have been selected or there's a selection involved"] pub repository_selection: InstallationRepositorySelection, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub single_file_name: ::std::option::Option<::std::string::String>, #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] pub single_file_paths: ::std::vec::Vec<::std::string::String>, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub suspended_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub suspended_by: ::std::option::Option, #[doc = "The ID of the user or organization this token is being scoped to."] pub target_id: i64, @@ -31597,14 +31597,14 @@ pub struct InstallationRepositoriesAdded { pub action: InstallationRepositoriesAddedAction, pub installation: Installation, #[doc = "An array of repository objects, which were added to the installation."] - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub repositories_added: ::std::vec::Vec, #[doc = "An array of repository objects, which were removed from the installation."] - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub repositories_removed: ::std::vec::Vec, #[doc = "Describe whether all repositories have been selected or there's a selection involved"] pub repository_selection: InstallationRepositoriesAddedRepositorySelection, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub requester: ::std::option::Option, pub sender: User, } @@ -32025,15 +32025,15 @@ pub struct InstallationRepositoriesRemoved { pub action: InstallationRepositoriesRemovedAction, pub installation: Installation, #[doc = "An array of repository objects, which were added to the installation."] - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub repositories_added: ::std::vec::Vec, #[doc = "An array of repository objects, which were removed from the installation."] - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub repositories_removed: ::std::vec::Vec, #[doc = "Describe whether all repositories have been selected or there's a selection involved"] pub repository_selection: InstallationRepositoriesRemovedRepositorySelection, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub requester: ::std::option::Option, pub sender: User, } @@ -32564,7 +32564,7 @@ pub struct InstallationSuspendInstallation { #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub app_slug: ::std::option::Option<::std::string::String>, pub created_at: InstallationSuspendInstallationCreatedAt, - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub events: ::std::vec::Vec, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub has_multiple_single_files: ::std::option::Option, @@ -32575,7 +32575,7 @@ pub struct InstallationSuspendInstallation { pub repositories_url: ::std::string::String, #[doc = "Describe whether all repositories have been selected or there's a selection involved"] pub repository_selection: InstallationSuspendInstallationRepositorySelection, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub single_file_name: ::std::option::Option<::std::string::String>, #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] pub single_file_paths: ::std::vec::Vec<::std::string::String>, @@ -36813,7 +36813,7 @@ pub struct InstallationUnsuspendInstallation { #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub app_slug: ::std::option::Option<::std::string::String>, pub created_at: InstallationUnsuspendInstallationCreatedAt, - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub events: ::std::vec::Vec, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub has_multiple_single_files: ::std::option::Option, @@ -36824,7 +36824,7 @@ pub struct InstallationUnsuspendInstallation { pub repositories_url: ::std::string::String, #[doc = "Describe whether all repositories have been selected or there's a selection involved"] pub repository_selection: InstallationUnsuspendInstallationRepositorySelection, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub single_file_name: ::std::option::Option<::std::string::String>, #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] pub single_file_paths: ::std::vec::Vec<::std::string::String>, @@ -40854,17 +40854,17 @@ impl ::std::convert::From for InstallationUpdatedAt { #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)] #[serde(deny_unknown_fields)] pub struct Issue { - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub active_lock_reason: ::std::option::Option, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub assignee: ::std::option::Option, - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub assignees: ::std::vec::Vec, pub author_association: AuthorAssociation, #[doc = "Contents of the issue"] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub body: ::std::option::Option<::std::string::String>, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub closed_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>, pub comments: i64, pub comments_url: ::std::string::String, @@ -40877,7 +40877,7 @@ pub struct Issue { pub labels_url: ::std::string::String, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub locked: ::std::option::Option, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub milestone: ::std::option::Option, pub node_id: ::std::string::String, pub number: i64, @@ -41067,7 +41067,7 @@ pub struct IssueComment { pub id: i64, pub issue_url: ::std::string::String, pub node_id: ::std::string::String, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub performed_via_github_app: ::std::option::Option, pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>, #[doc = "URL for the issue comment"] @@ -41357,17 +41357,17 @@ impl ::std::convert::TryFrom<::std::string::String> for IssueCommentCreatedActio #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)] #[serde(deny_unknown_fields)] pub struct IssueCommentCreatedIssue { - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub active_lock_reason: ::std::option::Option, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub assignee: ::std::option::Option, - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub assignees: ::std::vec::Vec, pub author_association: AuthorAssociation, #[doc = "Contents of the issue"] - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub body: ::std::option::Option<::std::string::String>, - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(default)] pub closed_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>, pub comments: i64, pub comments_url: ::std::string::String, @@ -41375,11 +41375,11 @@ pub struct IssueCommentCreatedIssue { pub events_url: ::std::string::String, pub html_url: ::std::string::String, pub id: i64, - #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + #[serde(default)] pub labels: ::std::vec::Vec