diff --git a/src/meta-srv/src/selector.rs b/src/meta-srv/src/selector.rs index 3873722a27b3..4c3a91caef2b 100644 --- a/src/meta-srv/src/selector.rs +++ b/src/meta-srv/src/selector.rs @@ -56,7 +56,7 @@ impl Default for SelectorOptions { } #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Default)] -#[serde(rename_all = "snake_case")] +#[serde(try_from = "String")] pub enum SelectorType { #[default] LoadBased, @@ -78,6 +78,14 @@ impl TryFrom<&str> for SelectorType { } } +impl TryFrom for SelectorType { + type Error = error::Error; + + fn try_from(value: String) -> Result { + SelectorType::try_from(value.as_str()) + } +} + #[cfg(test)] mod tests { use super::SelectorType;