From 3bec6a6102091fc65a630a0961a8d58474f553aa Mon Sep 17 00:00:00 2001 From: Alex Groleau Date: Mon, 16 Mar 2026 00:19:32 -0400 Subject: [PATCH] fixed jspg_schemas returning a drop now --- src/lib.rs | 10 ++++++---- src/tests/mod.rs | 17 ++++++++++------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 0c67ee1..8ed6a65 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -121,9 +121,10 @@ pub fn jspg_schemas() -> JsonB { Some(engine) => { let schemas_json = serde_json::to_value(&engine.database.schemas) .unwrap_or(serde_json::Value::Object(serde_json::Map::new())); - JsonB(schemas_json) + let drop = crate::drop::Drop::success_with_val(schemas_json); + JsonB(serde_json::to_value(drop).unwrap()) } - None => JsonB(serde_json::Value::Object(serde_json::Map::new())), + None => jspg_failure(), } } @@ -138,9 +139,10 @@ pub fn jspg_stems() -> JsonB { Some(engine) => { let stems_json = serde_json::to_value(&engine.database.stems) .unwrap_or(serde_json::Value::Object(serde_json::Map::new())); - JsonB(stems_json) + let drop = crate::drop::Drop::success_with_val(stems_json); + JsonB(serde_json::to_value(drop).unwrap()) } - None => JsonB(serde_json::Value::Object(serde_json::Map::new())), + None => jspg_failure(), } } diff --git a/src/tests/mod.rs b/src/tests/mod.rs index fbda713..9cfc000 100644 --- a/src/tests/mod.rs +++ b/src/tests/mod.rs @@ -54,13 +54,16 @@ fn test_library_api() { assert_eq!( schemas_drop.0, json!({ - "test_schema": { - "$id": "test_schema", - "type": "object", - "properties": { - "name": { "type": "string" } - }, - "required": ["name"] + "type": "drop", + "response": { + "test_schema": { + "$id": "test_schema", + "type": "object", + "properties": { + "name": { "type": "string" } + }, + "required": ["name"] + } } }) );