use serde::{Deserialize, Serialize};
use schemars::JsonSchema;
#[derive(Debug, Deserialize, JsonSchema)]
pub struct Input {
pub text: String,
}
#[derive(Debug, Serialize, JsonSchema)]
pub struct Output {
pub result: String,
}
pub struct TextUpper;
impl TextUpper {
pub const MODULE_ID: &'static str = "text.upper";
pub const DESCRIPTION: &'static str = "Convert a string to uppercase";
pub fn execute(input: Input) -> Output {
Output { result: input.text.to_uppercase() }
}
}
fn main() {
let input = Input { text: "hello apcore".to_string() };
let output = TextUpper::execute(input);
println!("{}", serde_json::to_string_pretty(&output).unwrap());
}