Optional Json doesn't work in axum 0.8.1 #3152
-
SummaryRan into an issue while moving from 0.7 to 0.8. The first breaking change was the url -- fixed that, ran into another that I can't seem to find an answer to:
Okay, let's use the debug handler macro to see what that actually means:
Use the macro:
Oh:
Hm. I guess this is the relevant part?
Is it a bug? axum version0.8.1 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This has been since added and will work in next releases although a little differently. Previously this returned If you want the old behavior and for now you can use |
Beta Was this translation helpful? Give feedback.
This has been since added and will work in next releases although a little differently. Previously this returned
None
for example when there was differentContent-Type
or if the json itself was malformed, this will now error out and just empty bodies without declared content type will returnNone
.If you want the old behavior and for now you can use
Result<Json<T>, _>
.