paperclip icon indicating copy to clipboard operation
paperclip copied to clipboard

Wrap actix-web codegen for route definitions

Open glademiller opened this issue 6 years ago • 5 comments

The convenience of using the get, delete etc proc macros for defining routes is great. I would love to have that same convenience when using paperclip.

glademiller avatar Jul 30 '19 17:07 glademiller

Um sorry, actix-web has proc macros???

wafflespeanut avatar Jul 30 '19 18:07 wafflespeanut

Yes indeed it does. https://github.com/actix/actix-web/tree/master/actix-web-codegen. I don't think it is well documented. Here is an example of how it is used https://github.com/actix/actix-web/blob/master/examples/basic.rs#L7.

glademiller avatar Jul 30 '19 21:07 glademiller

Oh nice! I never knew. I'll schedule that for 0.4.0.

wafflespeanut avatar Jul 31 '19 04:07 wafflespeanut

#289 added initial support for this.

tiagolobocastro avatar Feb 15 '21 22:02 tiagolobocastro

Is this issue still being worked on? I am still getting:

    |
10  |     cfg.service(scope("/refs").service(services![get_references, add_qref, add_href]));
    |                                ^^^^^^^ the trait `Mountable` is not implemented for `(get_references, add_qref, add_href)`
    |
note: required by a bound in `paperclip::actix::web::Scope::<actix_web::Scope<T>>::service`

in paperclip 0.7 and actix_web 4.0

OZoneGuy avatar May 23 '22 04:05 OZoneGuy