Commit b7d26e10 authored by Brad King's avatar Brad King Committed by Kitware Robot

Merge topic 'remove-strict-feature'

4b75cdcf serde: remove the `strict` feature
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: Brad King's avatarBrad King <brad.king@kitware.com>
Merge-request: !168
parents 9133ffaa 4b75cdcf
Pipeline #148605 passed with stages
in 5 minutes and 25 seconds
...@@ -22,6 +22,3 @@ chrono = { version = "~0.4", features = ["serde"] } ...@@ -22,6 +22,3 @@ chrono = { version = "~0.4", features = ["serde"] }
error-chain = ">= 0.9, < 0.11" error-chain = ">= 0.9, < 0.11"
serde = { version = "~1.0", features = ["derive"] } serde = { version = "~1.0", features = ["derive"] }
serde_json = "^1.0" serde_json = "^1.0"
[features]
strict = []
...@@ -55,7 +55,6 @@ enum_serialize!(ProjectVisibility -> "project visibility", ...@@ -55,7 +55,6 @@ enum_serialize!(ProjectVisibility -> "project visibility",
Public => "public" ; "visibilitylevel|public", Public => "public" ; "visibilitylevel|public",
); );
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// A hook for a project. /// A hook for a project.
pub struct ProjectSystemHook { pub struct ProjectSystemHook {
...@@ -131,7 +130,6 @@ impl From<HumanAccessLevel> for AccessLevel { ...@@ -131,7 +130,6 @@ impl From<HumanAccessLevel> for AccessLevel {
} }
} }
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// A project membership hook. /// A project membership hook.
pub struct ProjectMemberSystemHook { pub struct ProjectMemberSystemHook {
...@@ -176,7 +174,6 @@ enum_serialize!(UserEvent -> "user event", ...@@ -176,7 +174,6 @@ enum_serialize!(UserEvent -> "user event",
Destroy => "user_destroy", Destroy => "user_destroy",
); );
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// A user hook. /// A user hook.
pub struct UserSystemHook { pub struct UserSystemHook {
...@@ -209,7 +206,6 @@ enum_serialize!(KeyEvent -> "key event", ...@@ -209,7 +206,6 @@ enum_serialize!(KeyEvent -> "key event",
Destroy => "key_destroy", Destroy => "key_destroy",
); );
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// An SSH key hook. /// An SSH key hook.
pub struct KeySystemHook { pub struct KeySystemHook {
...@@ -240,7 +236,6 @@ enum_serialize!(GroupEvent -> "group event", ...@@ -240,7 +236,6 @@ enum_serialize!(GroupEvent -> "group event",
Destroy => "group_destroy", Destroy => "group_destroy",
); );
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// A group hook. /// A group hook.
pub struct GroupSystemHook { pub struct GroupSystemHook {
...@@ -275,7 +270,6 @@ enum_serialize!(GroupMemberEvent -> "group member event", ...@@ -275,7 +270,6 @@ enum_serialize!(GroupMemberEvent -> "group member event",
Remove => "user_remove_from_group", Remove => "user_remove_from_group",
); );
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// A group membership hook. /// A group membership hook.
pub struct GroupMemberSystemHook { pub struct GroupMemberSystemHook {
...@@ -316,7 +310,6 @@ enum_serialize!(PushEvent -> "push event", ...@@ -316,7 +310,6 @@ enum_serialize!(PushEvent -> "push event",
TagPush => "tag_push", TagPush => "tag_push",
); );
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// A push hook. /// A push hook.
pub struct PushSystemHook { pub struct PushSystemHook {
......
This diff is collapsed.
...@@ -64,7 +64,6 @@ impl AsRef<DateTime<Utc>> for HookDate { ...@@ -64,7 +64,6 @@ impl AsRef<DateTime<Utc>> for HookDate {
} }
} }
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// Project information exposed in hooks. /// Project information exposed in hooks.
pub struct ProjectHookAttrs { pub struct ProjectHookAttrs {
...@@ -94,7 +93,6 @@ pub struct ProjectHookAttrs { ...@@ -94,7 +93,6 @@ pub struct ProjectHookAttrs {
url: String, url: String,
} }
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// Wiki project information exposed in hooks. /// Wiki project information exposed in hooks.
pub struct ProjectWikiHookAttrs { pub struct ProjectWikiHookAttrs {
...@@ -110,7 +108,6 @@ pub struct ProjectWikiHookAttrs { ...@@ -110,7 +108,6 @@ pub struct ProjectWikiHookAttrs {
pub default_branch: String, pub default_branch: String,
} }
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// User information exposed in hooks. /// User information exposed in hooks.
pub struct UserHookAttrs { pub struct UserHookAttrs {
...@@ -122,7 +119,6 @@ pub struct UserHookAttrs { ...@@ -122,7 +119,6 @@ pub struct UserHookAttrs {
pub avatar_url: Option<String>, pub avatar_url: Option<String>,
} }
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// The identity of a user exposed through a hook. /// The identity of a user exposed through a hook.
pub struct HookCommitIdentity { pub struct HookCommitIdentity {
...@@ -132,7 +128,6 @@ pub struct HookCommitIdentity { ...@@ -132,7 +128,6 @@ pub struct HookCommitIdentity {
pub email: String, pub email: String,
} }
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// Commit information exposed in hooks. /// Commit information exposed in hooks.
pub struct CommitHookAttrs { pub struct CommitHookAttrs {
...@@ -150,7 +145,6 @@ pub struct CommitHookAttrs { ...@@ -150,7 +145,6 @@ pub struct CommitHookAttrs {
pub removed: Option<Vec<String>>, pub removed: Option<Vec<String>>,
} }
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// A push hook. /// A push hook.
pub struct PushHook { pub struct PushHook {
...@@ -211,7 +205,6 @@ enum_serialize!(IssueAction -> "issue action", ...@@ -211,7 +205,6 @@ enum_serialize!(IssueAction -> "issue action",
Reopen => "reopen", Reopen => "reopen",
); );
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// Issue information exposed in hooks. /// Issue information exposed in hooks.
pub struct IssueHookAttrs { pub struct IssueHookAttrs {
...@@ -266,7 +259,6 @@ pub struct IssueHookAttrs { ...@@ -266,7 +259,6 @@ pub struct IssueHookAttrs {
pub action: Option<IssueAction>, pub action: Option<IssueAction>,
} }
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// An issue hook. /// An issue hook.
pub struct IssueHook { pub struct IssueHook {
...@@ -304,7 +296,6 @@ enum_serialize!(MergeRequestAction -> "merge request action", ...@@ -304,7 +296,6 @@ enum_serialize!(MergeRequestAction -> "merge request action",
Merge => "merge", Merge => "merge",
); );
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// Merge parameters for a merge request. /// Merge parameters for a merge request.
pub struct MergeRequestParams { pub struct MergeRequestParams {
...@@ -332,7 +323,6 @@ impl MergeRequestParams { ...@@ -332,7 +323,6 @@ impl MergeRequestParams {
} }
} }
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// Merge request information exposed in hooks. /// Merge request information exposed in hooks.
pub struct MergeRequestHookAttrs { pub struct MergeRequestHookAttrs {
...@@ -406,7 +396,6 @@ pub struct MergeRequestHookAttrs { ...@@ -406,7 +396,6 @@ pub struct MergeRequestHookAttrs {
lock_version: Option<u64>, lock_version: Option<u64>,
} }
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// A merge request hook. /// A merge request hook.
pub struct MergeRequestHook { pub struct MergeRequestHook {
...@@ -436,7 +425,6 @@ enum_serialize!(SnippetType -> "snippet type", ...@@ -436,7 +425,6 @@ enum_serialize!(SnippetType -> "snippet type",
Personal => "PersonalSnippet", Personal => "PersonalSnippet",
); );
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// Snippet information exposed in hooks. /// Snippet information exposed in hooks.
pub struct SnippetHookAttrs { pub struct SnippetHookAttrs {
...@@ -474,7 +462,6 @@ enum_serialize!(WikiPageAction -> "wiki page action", ...@@ -474,7 +462,6 @@ enum_serialize!(WikiPageAction -> "wiki page action",
Update => "update", Update => "update",
); );
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// Wiki information exposed in hooks. /// Wiki information exposed in hooks.
pub struct WikiPageHookAttrs { pub struct WikiPageHookAttrs {
...@@ -493,7 +480,6 @@ pub struct WikiPageHookAttrs { ...@@ -493,7 +480,6 @@ pub struct WikiPageHookAttrs {
pub action: WikiPageAction, pub action: WikiPageAction,
} }
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// Diff information exposed in hooks. /// Diff information exposed in hooks.
pub struct DiffHookAttrs { pub struct DiffHookAttrs {
...@@ -516,7 +502,6 @@ pub struct DiffHookAttrs { ...@@ -516,7 +502,6 @@ pub struct DiffHookAttrs {
pub too_large: bool, pub too_large: bool,
} }
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
// FIXME(gitlab#21467): This can apparently be a string sometimes. // FIXME(gitlab#21467): This can apparently be a string sometimes.
// https://gitlab.com/gitlab-org/gitlab-ce/issues/21467 // https://gitlab.com/gitlab-org/gitlab-ce/issues/21467
...@@ -532,7 +517,6 @@ pub struct PositionHookAttrs { ...@@ -532,7 +517,6 @@ pub struct PositionHookAttrs {
pub new_path: String, pub new_path: String,
} }
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// Note (comment) information exposed in hooks. /// Note (comment) information exposed in hooks.
pub struct NoteHookAttrs { pub struct NoteHookAttrs {
...@@ -608,7 +592,6 @@ impl NoteHookAttrs { ...@@ -608,7 +592,6 @@ impl NoteHookAttrs {
} }
} }
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// A note hook. /// A note hook.
pub struct NoteHook { pub struct NoteHook {
...@@ -633,7 +616,6 @@ pub struct NoteHook { ...@@ -633,7 +616,6 @@ pub struct NoteHook {
repository: Value, repository: Value,
} }
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// Build user information exposed in hooks. /// Build user information exposed in hooks.
pub struct BuildUserHookAttrs { pub struct BuildUserHookAttrs {
...@@ -645,7 +627,6 @@ pub struct BuildUserHookAttrs { ...@@ -645,7 +627,6 @@ pub struct BuildUserHookAttrs {
pub email: Option<String>, pub email: Option<String>,
} }
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// Build commit information exposed in hooks. /// Build commit information exposed in hooks.
pub struct BuildCommitHookAttrs { pub struct BuildCommitHookAttrs {
...@@ -666,7 +647,6 @@ pub struct BuildCommitHookAttrs { ...@@ -666,7 +647,6 @@ pub struct BuildCommitHookAttrs {
pub finished_at: Option<HookDate>, pub finished_at: Option<HookDate>,
} }
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// Project information exposed in build hooks. /// Project information exposed in build hooks.
pub struct BuildProjectHookAttrs { pub struct BuildProjectHookAttrs {
...@@ -684,7 +664,6 @@ pub struct BuildProjectHookAttrs { ...@@ -684,7 +664,6 @@ pub struct BuildProjectHookAttrs {
pub visibility_level: u64, pub visibility_level: u64,
} }
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// A build hook. /// A build hook.
pub struct BuildHook { pub struct BuildHook {
...@@ -719,7 +698,6 @@ pub struct BuildHook { ...@@ -719,7 +698,6 @@ pub struct BuildHook {
pub repository: BuildProjectHookAttrs, pub repository: BuildProjectHookAttrs,
} }
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
/// A wiki page hook. /// A wiki page hook.
pub struct WikiPageHook { pub struct WikiPageHook {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment