You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have looked for existing issues (including closed) about this
Bug Report
Version
Latest axum-0.8 after upgrade from 0.7.
Platform
Fedora 41, but does not matter in this case.
Crates
Latest axum-0.8 + extras.
Description
Not sure if this is a bug or actually working as intended. I just upgraded from 0.7 to 0.8 and have some issues with the new OptionalFromRequestParts.
The issue is, that both of them can't be implemented at the same time for a given struct, since they both implement fn from_request_parts() which ends up in a conflict with multiple from_request_parts found. The issue is, that I need a non-optional extractor in lots of endpoints and an Option<_> in just very few and I don't really get it, how I should resolve this issue now. The only solution I can think of is duplicating the whole struct and create a new one with Optional appended and lots of boilerplate and conversion impl's.
Is there anything I did miss about how I can do this with v0.8? I ran into the issue with a custom struct Session for now, but will have the same problem in some other cases as well further down the road.
Edit:
Sorry I just saw that not the trait itself throws this error, but a
Instead of calling these trait methods directly, I'd recommend using RequestPartsExt, that would have avoided this issue. There's also an equivalent RequestExt.
Instead of calling these trait methods directly, I'd recommend using RequestPartsExt, that would have avoided this issue. There's also an equivalent RequestExt.
Bug Report
Version
Latest
axum-0.8
after upgrade from0.7
.Platform
Fedora 41, but does not matter in this case.
Crates
Latest
axum-0.8
+ extras.Description
Not sure if this is a bug or actually working as intended. I just upgraded from
0.7
to0.8
and have some issues with the newOptionalFromRequestParts
.The issue is, that both of them can't be implemented at the same time for a given
struct
, since they both implementfn from_request_parts()
which ends up in a conflict withmultiple from_request_parts found
. The issue is, that I need a non-optional extractor in lots of endpoints and anOption<_>
in just very few and I don't really get it, how I should resolve this issue now. The only solution I can think of is duplicating the whole struct and create a new one withOptional
appended and lots of boilerplate and conversion impl's.Is there anything I did miss about how I can do this with
v0.8
? I ran into the issue with a customstruct Session
for now, but will have the same problem in some other cases as well further down the road.Edit:
Sorry I just saw that not the trait itself throws this error, but a
inside the extractor. Will have a 2nd look at where this is coming from.
The text was updated successfully, but these errors were encountered: