Releases: ym-project/actix-msgpack
Releases Β· ym-project/actix-msgpack
v0.1.4
What's Changed
- docs(#40): π add
error_handler
config option to README by @ym-project in #42 - feat(#2): β¨ add
content_type
config option by @ym-project in #43use actix_msgpack::MsgPackConfig; use actix_web::{HttpResponse, HttpServer, App, web::Data}; #[actix_web::main] async fn main() { HttpServer::new(|| { let mut config = MsgPackConfig::default(); config.content_type(|mime_type| mime_type == mime::APPLICATION_JSON); App::new().app_data(Data::new(config)).service(...) } }
Full Changelog: v0.1.3...v0.1.4
v0.1.3
What's Changed
- feat(#37): β¨ add
error_handler
config option by @ym-project in #39
You can set error handler to overwrite default serde error:use actix_msgpack::MsgPackConfig; use actix_web::{HttpResponse, HttpServer, App, web::Data}; #[actix_web::main] async fn main() { HttpServer::new(|| { let mut config = MsgPackConfig::default(); config.error_handler(|err, _req| { InternalError::from_response(err, HttpResponse::BadRequest().finish()).into() }); App::new().app_data(Data::new(config)).service(...) } }
v0.1.1
What's Changed
- feat(#29): β¨ add
Responder
trait by @ym-project in #33
Now you can use extracted data as response data:#[post("/")] async fn index(data: MsgPack<Data>) -> impl Responder { data }
Full Changelog: v0.1.0...v0.1.1
v0.1.0
β οΈ This release contains backwards-incompatible changes β οΈ
Remove responder with compact representation.
Now there is only:
#[post("/")]
async fn index(data: MsgPack<Data>) -> HttpResponse {
HttpResponse::Ok().msgpack(...)
}
What's Changed
- feat(#28): β»οΈ leave only one responder
- docs(#28): π update responder example, remove extra brackets by @ym-project in #32
Full Changelog: v0.0.5...v0.1.0
v0.0.5
What's Changed
- ci(#5): π· add PR check pipeline by @ym-project in #25
- ci(#26): π· add cache to workflows by @ym-project in #27
- fix(#30): π exclude
.github
folder from package by @ym-project in #31
Full Changelog: v0.0.4...v0.0.5
v0.0.4
Changes
-
add responders
msgpack_named
andmsgpack
msgpack_named
- responder with field names (most likely you are looking for this option)msgpack
- responder with compact representation
Example
#[derive(Serialize)] struct Data { payload: bool, } #[post("/")] async fn index(data: MsgPack<Data>) -> HttpResponse { let payload = Data { payload: true }; HttpResponse::Ok().msgpack_named(payload) }
-
add crate publishing after github release creation
Commits
- ci(#5): π· add publishing pipeline by @ym-project in #22
- feat(#23): β¨ add responders
msgpack
andmsgpack_named
by @ym-project in #24
Full Changelog: v0.0.3...v0.0.4
v0.0.3
What's Changed
- docs(#15): π extend
README
by @ym-project in #20 - fix(#11): π do not rely on Content-Length header by @ym-project in #21
Full Changelog: v0.0.2...v0.0.3
v0.0.2
What's Changed
- fix(#18): π set correct repository link by @ym-project in #19
Full Changelog: v0.0.1...v0.0.2