We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
poem::Response
poem_openapi::payload::Response<()>
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"), )) } }
The text was updated successfully, but these errors were encountered:
I've found this conversion as a workaround:
pub struct IndexApi; #[poem_openapi::OpenApi] impl IndexApi { #[oai(path = "/", method = "get")] async fn index(&self) -> poem::Result<()> { Err(poem::error::Error::from_response( poem::IntoResponse::into_response(poem::web::Redirect::see_other( "http://127.0.0.1:3000/api/v1/swagger".to_owned(), )), )) } }
Sorry, something went wrong.
No branches or pull requests
How should a redirect be done with poem_openapi?
Error:
poem::Response
andpoem_openapi::payload::Response<()>
have similar names, but are actually distinct typesIn:
The text was updated successfully, but these errors were encountered: