chridou / http-api-problem

A problem type to be returned by HTTP APIs
Apache License 2.0
54 stars 12 forks source link

Add experimental warp support #17

Closed thomaseizinger closed 4 years ago

thomaseizinger commented 4 years ago

warp 0.2 makes some changes in how it handles custom rejections. To allow an error to be used as a custom rejection, it needs to implement warp::reject::Reject.

This patch implements this trait on that type.

chridou commented 4 years ago

Warp support should be in this lib.

I also had a look into warp and found out that it uses hyper::Body. Maybe we can also add an implementation for this which would then add capabilities for all web frameworks based on hyper.

Edit: All frameworks that use the Response<T> from the http crate with hyper::Body as the payload.

thomaseizinger commented 4 years ago

I also had a look into warp and found out that it uses hyper::Body. Maybe we can also add an implementation for this which would then add capabilities for all web frameworks based on hyper.

Totally agree, I'd expect this to be a separate feature-flag (with_hyper if we follow the current convention) though, no?

thomaseizinger commented 4 years ago

warp 0.2 got released!

I've updated the PR to use the version from crates.io!