#[derive(Debug, Clone, PartialEq)]
pub enum ParamLocation {
Path,
Query,
Header,
}
#[derive(Debug, Clone, PartialEq)]
pub struct ApiParam {
pub name: String,
pub location: ParamLocation,
pub required: bool,
pub schema: serde_json::Value,
pub description: Option<String>,
}
#[derive(Debug, Clone, PartialEq)]
pub struct ApiOperation {
pub tool_name: String,
pub method: String,
pub path: String,
pub description: String,
pub parameters: Vec<ApiParam>,
pub request_body_schema: Option<serde_json::Value>,
pub input_schema: serde_json::Value,
pub hint: Option<String>,
}
impl ApiOperation {
pub fn new(tool_name: String, method: String, path: String, description: String) -> Self {
Self {
tool_name,
method,
path,
description,
parameters: Vec::new(),
request_body_schema: None,
input_schema: serde_json::json!({"type": "object", "properties": {}}),
hint: None,
}
}
}