Omid Rad

Results 159 comments of Omid Rad

@tiagolobocastro thanks, it's awesome. Yep, the `skip_serializing` and `skip_deserializing` are harder. Since it needs to create two different definitions (for example `/definitions/Pet_serialize` and `/definitions/Pet_deserialize`, instead of just `/definitions/Pet`) automatically, and...

Thanks @dunnock. I'm using that, but it needs to be customized. For example, generally, 404 means Not Found... but for _users_, it can mean, "The user is inactive or does...

I did this with introducing a new struct. It was similar to: ``` #[derive(Deserialize, Apiv2Schema)] pub struct MainType { pub something: Option, } ``` Now it's like: ``` #[derive(Deserialize)] pub...

So I think there is no better way :D Going to close it :)

Hey @platy, thanks. I couldn't make it work with: ``` #[derive(Deserialize, Apiv2Schema)] pub struct QueryParams { pub limit: i32, pub filter: Option, } ``` nor this: ``` #[derive(Deserialize, Apiv2Schema)] pub...

You are right. The second route here doesn't work in actix: ``` #[actix_web::main] async fn main() -> std::io::Result { HttpServer::new(|| App::new() .configure(router) ).bind("127.0.0.1:8080")? .run().await } pub fn router(service_config: &mut web::ServiceConfig)...

Yes @platy, that works. But I want to `.configure` `ServiceConfig`. Just imagine something like the following code (check the `router` function): ``` #[actix_web::main] async fn main() -> std::io::Result { HttpServer::new(||...

I found another problem in the same area! The following code doesn't work, because we have a path normalizer! If you comment the Normalizer middleware, it will work! ``` #[actix_web::main]...

It's not a solution, but a workaround. You can still have scope, if you use resource: ``` web::scope("/example") .service( web::resource("") .route(web::get().to(get_users)) .route(web::post().to(create_user)) ), ```