pub async fn write_json_response<T>( resp: &mut dyn IHttpResponse, value: &T, ) -> Result<(), Error>where T: Serialize + Send,
Helper: build a JSON response by serializing a value and writing it.