diff --git a/lambda/examples/hello-with-ctx.rs b/lambda/examples/hello-with-ctx.rs index 58549494..957c2a58 100644 --- a/lambda/examples/hello-with-ctx.rs +++ b/lambda/examples/hello-with-ctx.rs @@ -1,9 +1,10 @@ use lambda::lambda; +use serde_json::Value; type Error = Box; #[lambda] #[tokio::main] -async fn main(event: String) -> Result { +async fn main(event: Value) -> Result { Ok(event) } diff --git a/lambda/examples/hello-without-macro.rs b/lambda/examples/hello-without-macro.rs index e5ab866b..dd20bd10 100644 --- a/lambda/examples/hello-without-macro.rs +++ b/lambda/examples/hello-without-macro.rs @@ -1,4 +1,5 @@ use lambda::handler_fn; +use serde_json::Value; type Error = Box; @@ -9,6 +10,6 @@ async fn main() -> Result<(), Error> { Ok(()) } -async fn func(event: String) -> Result { +async fn func(event: Value) -> Result { Ok(event) } diff --git a/lambda/examples/hello.rs b/lambda/examples/hello.rs index 58549494..957c2a58 100644 --- a/lambda/examples/hello.rs +++ b/lambda/examples/hello.rs @@ -1,9 +1,10 @@ use lambda::lambda; +use serde_json::Value; type Error = Box; #[lambda] #[tokio::main] -async fn main(event: String) -> Result { +async fn main(event: Value) -> Result { Ok(event) } diff --git a/lambda/src/lib.rs b/lambda/src/lib.rs index c5696736..18568aca 100644 --- a/lambda/src/lib.rs +++ b/lambda/src/lib.rs @@ -23,12 +23,13 @@ //! //! ```no_run //! use lambda::lambda; +//! use serde_json::Value; //! //! type Error = Box; //! //! #[lambda] //! #[tokio::main] -//! async fn main(event: String) -> Result { +//! async fn main(event: Value) -> Result { //! Ok(event) //! } //! ``` @@ -136,6 +137,7 @@ where /// # Example /// ```no_run /// use lambda::handler_fn; +/// use serde_json::Value; /// /// type Error = Box; /// @@ -146,8 +148,8 @@ where /// Ok(()) /// } /// -/// async fn func(s: String) -> Result { -/// Ok(s) +/// async fn func(event: Value) -> Result { +/// Ok(event) /// } /// ``` pub async fn run(handler: F) -> Result<(), Err>