library test suite for drop validation, fixed drop return structures

This commit is contained in:
2026-02-19 20:14:21 -05:00
parent 55b93d9957
commit ad78896f72
8 changed files with 160 additions and 41 deletions

View File

@ -13,7 +13,7 @@ pub struct Drop {
#[serde(skip_serializing_if = "Option::is_none")]
pub response: Option<Value>,
#[serde(default)]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub errors: Vec<Error>,
}
@ -29,7 +29,7 @@ impl Drop {
pub fn success() -> Self {
Self {
type_: "drop".to_string(),
response: Some(serde_json::json!({ "result": "success" })), // Or appropriate success response
response: Some(serde_json::json!("success")),
errors: vec![],
}
}
@ -53,8 +53,6 @@ impl Drop {
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Error {
#[serde(skip_serializing_if = "Option::is_none")]
pub punc: Option<String>,
pub code: String,
pub message: String,
pub details: ErrorDetails,