In my situation, my function can only have signature:
pub async fn do_something(mut req: Request<Body>) -> Result<Response<Body>, CustomError> {
.....
}
I know how to return a body of string in my function as follow:
Ok(Response::new(Body::from("some string".to_string())))
However, something like this does not work with serde::Value; it only worked with strings.
What is the proper way to return a serde::Value while maintaining the same method signature?