Skip to content

Releases: ym-project/actix-msgpack

v0.1.4

29 Aug 20:51
Compare
Choose a tag to compare

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 #43
    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.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

25 Aug 20:25
Compare
Choose a tag to compare

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

24 Dec 07:23
Compare
Choose a tag to compare

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

23 Dec 06:48
Compare
Choose a tag to compare
⚠️ 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

23 Dec 06:01
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.0.4...v0.0.5

v0.0.4

16 Sep 11:01
Compare
Choose a tag to compare

Changes

  • add responders msgpack_named and msgpack

    • 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

Full Changelog: v0.0.3...v0.0.4

v0.0.3

10 Sep 15:15
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.0.2...v0.0.3

v0.0.2

10 Sep 09:28
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.0.1...v0.0.2

v0.0.1

10 Sep 09:27
Compare
Choose a tag to compare

πŸŽ‰ Publish the crate