fix: generate default schema for tools with no params (#446)
* fix: generate default schema for tools with no params
This commit is contained in:
parent
57fc428c57
commit
717ec56e23
1 changed files with 14 additions and 4 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Reference in a new issue