poem
poem copied to clipboard
Redirect response type error
How should a redirect be done with poem_openapi?
Error:
poem::Response
and poem_openapi::payload::Response<()>
have similar names, but are actually distinct types
In:
#[poem_openapi::OpenApi]
impl IndexApi {
#[oai(path = "/", method = "get")]
async fn index(&self) -> poem::Result<poem_openapi::payload::Response<()>> {
Ok(poem::IntoResponse::into_response(
poem::web::Redirect::see_other("http://127.0.0.1:3000/api/v1/swagger"),
))
}
}