cloudevents / sdk-rust

Rust library to interact with CloudEvents
Apache License 2.0
177 stars 61 forks source link

How to serialize/deserialize Vec<Event> in actix-web? #211

Open Lorry1123 opened 1 year ago

Lorry1123 commented 1 year ago

It seems that there is no impl Responder for Vec<Event> nor impl FromRequest for Vec<Event> in actix feature, but I did find Vec<Event> support in reqwest feature. Did I miss any thing?

Here's the code:

#[get("/test")]
async fn test(events: Vec<Event>) -> Result<Vec<Event>> {
    Ok(events)
}
ozabalaferrera commented 2 weeks ago

Hi, I'm not sure if this still matters to you, but you're correct. For the current version of cloudevents-sdk (0.7.0) there is no batch-mode support in the actix binding. This should be relatively easy to add. I will try to improve batch-mode support after my current PR is accepted.