Replies: 1 comment 6 replies
-
Do you mean something like this? |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Hello.
I'm trying to implement a complex nested router with axum_utoipa.
I need to generate the openapi.json from the router, and the state I'm using is very big and I cannot freely generate one from scratch.
So my plan was to make a function return the Router with the state missing, and:
This is just the reason why I'm asking this strange question.
Basically I need for 3 specific routes a middleware that do some authentication work, and this middleware needs to read information from the State.
The problem is that the middleware requires to be defined a State upfront and cannot read the state from the router itself, breaking completely my present pipeline.
Is there some way/workaround to catch the state inside a middleware WITHOUT needing to give it upfront and instead reading it from the Router object?
axum version
0.8.4
Beta Was this translation helpful? Give feedback.
All reactions