Skip to content
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

FromRequestParts derive macro uses wrong rejection #3160

Open
1 task done
Turbo87 opened this issue Jan 8, 2025 · 0 comments
Open
1 task done

FromRequestParts derive macro uses wrong rejection #3160

Turbo87 opened this issue Jan 8, 2025 · 0 comments
Labels
A-axum-macros C-bug Category: This is a bug.

Comments

@Turbo87
Copy link
Collaborator

Turbo87 commented Jan 8, 2025

  • I have looked for existing issues (including closed) about this

Bug Report

Version

0.8.1

Crates

axum-macros

Description

https://docs.rs/axum/latest/axum/extract/derive.FromRequest.html#the-whole-type-at-once claims that:

The rejection will be the “via extractors”’s rejection. For the previous example that would be axum::extract::rejection::ExtensionRejection.

but from what I've found, this is incorrect. I've tried to use #[from_request(via(Query))] on a struct, assuming that the corresponding rejection would be QueryRejection, but instead axum::response::Response was put in the derived impl (documented as the default at https://docs.rs/axum/0.8.1/axum/extract/derive.FromRequest.html#the-rejection).

I assume that this is a bug in the derive macro for at least FromRequestParts, but probably FromRequest too.

@Turbo87 Turbo87 added C-bug Category: This is a bug. A-axum-macros labels Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-axum-macros C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

1 participant