-
I want to migrate my poem route handler to poem-openapi I read the document here, but when I add poem/poem-openapi/src/docs/openapi.md Line 18 in d53c91c Here is the StateExtractor define, it works in normal poem handler function pub struct StateExtractor {
pub cookie_jar: CookieJar,
pub graph_service: Arc<GraphService>,
pub session_store: MemoryStore,
}
#[tonic::async_trait]
impl<'a> FromRequest<'a> for &'a StateExtractor {
type Error = std::convert::Infallible;
async fn from_request(req: &'a Request, _body: &mut RequestBody) -> Result<Self, Self::Error> {
Ok(req.extensions().get::<StateExtractor>().unwrap())
}
} |
Beta Was this translation helpful? Give feedback.
Answered by
sunli829
Oct 1, 2021
Replies: 1 comment
-
Thank you for reporting this, I fixed it and added the test in poem/poem-openapi/tests/api.rs Line 372 in 421e858 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
pymongo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for reporting this, I fixed it and added the test in
v0.7.7
. 🙂poem/poem-openapi/tests/api.rs
Line 372 in 421e858