fix: generate default schema for tools with no params (#446)

* fix: generate default schema for tools with no params
This commit is contained in:
V 2025-09-26 03:16:08 -07:00 • committed by GitHub
commit 717ec56e23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -121,8 +121,14 @@ async fn test_tool_macros() {
async fn test_tool_macros_with_empty_param() {
let _attr = Server::empty_param_tool_attr();
println!("{_attr:?}");
assert!(_attr.input_schema.get("type").is_none());
assert!(_attr.input_schema.get("properties").is_none());
assert_eq!(
_attr.input_schema.get("type"),
Some(&serde_json::Value::String("object".to_string()))
);
assert_eq!(
_attr.input_schema.get("properties"),
Some(&serde_json::Value::Object(serde_json::Map::new()))
);
}
#[tokio::test]