This commit is contained in:
2025-10-31 01:19:01 +01:00
parent 5b5916ff92
commit fa43bc749e
16 changed files with 878 additions and 872 deletions
+9
View File
@@ -1,3 +1,4 @@
use serde::Deserialize;
use serde_json::Value;
pub enum NullableValue {
@@ -14,3 +15,11 @@ pub fn classify_nullable(optional_value: Option<&Value>) -> Result<NullableValue
Some(other) => Err(format!("expected string or null, got {other}")),
}
}
pub fn deserialize_patch_field<'de, D, T>(deserializer: D) -> Result<Option<Option<T>>, D::Error>
where
D: serde::Deserializer<'de>,
T: Deserialize<'de>,
{
Option::<T>::deserialize(deserializer).map(Some)
}