-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider making web::Path
and web::Query
fields public again
#2016
Comments
web::Path
and web::Query
field public againweb::Path
and web::Query
fields public again
It has been considered a mistake to make the Path inner field public in v3 for reasons that do not affect Json or Form or Query. Given Path is primarily used with tuples, a public inner field was making it quite confusing for developers that there was a difference between It's like the Query public inner field was removed by mistake, or else I do not recall the rationale for it. |
The rationale makes sense. Unfortunately, in our codebase, we destruct If most users make use of the
If so, it is possible to make at least it's field public? |
Hi everyone, I am using In v3: pub async fn some_handler(
web::Path(tutor_id, course_id): web::Path<(i32, i32)>,
) -> ... { In v4: we have to just mention some pub async fn some_handler(
params: web::Path<(i32, i32)>,
) -> ... {
let (tutor_id, course_id) = params.into_inner(); Update: |
Yep we're going to fill in the migration guide before stable release. |
To be able to update one of my projects with little hassle, I created this https://github.com/ModProg/actix-web-public-path . Still think it is very nice to be able to declare your request like functions and get your path arguments directly in the declaration without need for an additional |
Should have mentioned it here but there's a variant with public field in actix-web-lab, too. https://docs.rs/actix-web-lab/0.15.0/actix_web_lab/extract/struct.Path.html |
Hello! First of all thanks for the awesome work being done in the libraries!
While updating our company's codebase to tokio v1 (and thus actix-web v4) we noticed that #1894 made the field of
web::Path
andweb::Query
private. This change alone broke almost all our services' routes.Given that the
web::Json
andweb::Form
still have their field public, it would be possible to rollback the change made in the former types? Having the fields private is a big burden for us, having to call.into_inner()
everywhere is pretty annoying.I can send a PR if this change is desired by the maintainers.
Your Environment
rustc -V
):nightly-2021-01-25
4.0.0-beta.3
The text was updated successfully, but these errors were encountered: