forked from loafle/openapi-generator-original
[Rust] Bump axum and axum-extra (#20548)
* Bump axum and axum-extra to latest version. - This bump requires fixing path parameters due to matchit transitive dependency changes (See https://github.com/tokio-rs/axum/pull/2645). - The `Host` extractor has been moved from `axum` to `axum-extra`. - Axum now ships multipart extractor support, switch to that. * Update rust-axum samples
This commit is contained in:
parent
aeb7caf9b1
commit
21bf477da3
@ -427,7 +427,7 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
|
||||
for (CodegenParameter param : op.pathParams) {
|
||||
// Replace {baseName} with {paramName} for format string
|
||||
String paramSearch = "{" + param.baseName + "}";
|
||||
String paramReplace = ":" + param.paramName;
|
||||
String paramReplace = "{" + param.paramName + "}";
|
||||
|
||||
axumPath = axumPath.replace(paramSearch, paramReplace);
|
||||
}
|
||||
|
@ -40,8 +40,8 @@ conversion = [
|
||||
|
||||
[dependencies]
|
||||
async-trait = "0.1"
|
||||
axum = "0.7"
|
||||
axum-extra = { version = "0.9", features = ["cookie", "multipart"] }
|
||||
axum = { version = "0.8", features = ["multipart"] }
|
||||
axum-extra = { version = "0.10", features = ["cookie"] }
|
||||
base64 = "0.22"
|
||||
bytes = "1"
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
|
@ -37,7 +37,7 @@ pub trait ErrorHandler<E: std::fmt::Debug + Send + Sync + 'static = ()> {
|
||||
async fn handle_error(
|
||||
&self,
|
||||
method: &::http::Method,
|
||||
host: &axum::extract::Host,
|
||||
host: &axum_extra::extract::Host,
|
||||
cookies: &axum_extra::extract::CookieJar,
|
||||
error: E
|
||||
) -> Result<axum::response::Response, http::StatusCode> {
|
||||
@ -47,4 +47,4 @@ pub trait ErrorHandler<E: std::fmt::Debug + Send + Sync + 'static = ()> {
|
||||
.body(axum::body::Body::empty())
|
||||
.map_err(|_| http::StatusCode::INTERNAL_SERVER_ERROR)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
use async_trait::async_trait;
|
||||
use axum::extract::*;
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::Method;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use axum::{body::Body, extract::*, response::Response, routing::*};
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::{header::CONTENT_TYPE, HeaderMap, HeaderName, HeaderValue, Method, StatusCode};
|
||||
use tracing::error;
|
||||
|
@ -18,8 +18,8 @@ conversion = [
|
||||
|
||||
[dependencies]
|
||||
async-trait = "0.1"
|
||||
axum = "0.7"
|
||||
axum-extra = { version = "0.9", features = ["cookie", "multipart"] }
|
||||
axum = { version = "0.8", features = ["multipart"] }
|
||||
axum-extra = { version = "0.10", features = ["cookie"] }
|
||||
base64 = "0.22"
|
||||
bytes = "1"
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
|
@ -33,7 +33,7 @@ pub trait ErrorHandler<E: std::fmt::Debug + Send + Sync + 'static = ()> {
|
||||
async fn handle_error(
|
||||
&self,
|
||||
method: &::http::Method,
|
||||
host: &axum::extract::Host,
|
||||
host: &axum_extra::extract::Host,
|
||||
cookies: &axum_extra::extract::CookieJar,
|
||||
error: E,
|
||||
) -> Result<axum::response::Response, http::StatusCode> {
|
||||
|
@ -1,6 +1,6 @@
|
||||
use async_trait::async_trait;
|
||||
use axum::extract::*;
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::Method;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use axum::{body::Body, extract::*, response::Response, routing::*};
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::{header::CONTENT_TYPE, HeaderMap, HeaderName, HeaderValue, Method, StatusCode};
|
||||
use tracing::error;
|
||||
@ -32,7 +32,7 @@ where
|
||||
get(get_payment_methods::<I, A, E, C>),
|
||||
)
|
||||
.route(
|
||||
"/v71/paymentMethods/:id",
|
||||
"/v71/paymentMethods/{id}",
|
||||
get(get_payment_method_by_id::<I, A, E, C>),
|
||||
)
|
||||
.route("/v71/payments", post(post_make_payment::<I, A, E, C>))
|
||||
|
@ -18,8 +18,8 @@ conversion = [
|
||||
|
||||
[dependencies]
|
||||
async-trait = "0.1"
|
||||
axum = "0.7"
|
||||
axum-extra = { version = "0.9", features = ["cookie", "multipart"] }
|
||||
axum = { version = "0.8", features = ["multipart"] }
|
||||
axum-extra = { version = "0.10", features = ["cookie"] }
|
||||
base64 = "0.22"
|
||||
bytes = "1"
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
|
@ -1,6 +1,6 @@
|
||||
use async_trait::async_trait;
|
||||
use axum::extract::*;
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::Method;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -8,7 +8,7 @@ pub trait ErrorHandler<E: std::fmt::Debug + Send + Sync + 'static = ()> {
|
||||
async fn handle_error(
|
||||
&self,
|
||||
method: &::http::Method,
|
||||
host: &axum::extract::Host,
|
||||
host: &axum_extra::extract::Host,
|
||||
cookies: &axum_extra::extract::CookieJar,
|
||||
error: E,
|
||||
) -> Result<axum::response::Response, http::StatusCode> {
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use axum::{body::Body, extract::*, response::Response, routing::*};
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::{header::CONTENT_TYPE, HeaderMap, HeaderName, HeaderValue, Method, StatusCode};
|
||||
use tracing::error;
|
||||
|
@ -18,8 +18,8 @@ conversion = [
|
||||
|
||||
[dependencies]
|
||||
async-trait = "0.1"
|
||||
axum = "0.7"
|
||||
axum-extra = { version = "0.9", features = ["cookie", "multipart"] }
|
||||
axum = { version = "0.8", features = ["multipart"] }
|
||||
axum-extra = { version = "0.10", features = ["cookie"] }
|
||||
base64 = "0.22"
|
||||
bytes = "1"
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
|
@ -1,6 +1,6 @@
|
||||
use async_trait::async_trait;
|
||||
use axum::extract::*;
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::Method;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -1,6 +1,6 @@
|
||||
use async_trait::async_trait;
|
||||
use axum::extract::*;
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::Method;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -10,7 +10,7 @@ pub trait ErrorHandler<E: std::fmt::Debug + Send + Sync + 'static = ()> {
|
||||
async fn handle_error(
|
||||
&self,
|
||||
method: &::http::Method,
|
||||
host: &axum::extract::Host,
|
||||
host: &axum_extra::extract::Host,
|
||||
cookies: &axum_extra::extract::CookieJar,
|
||||
error: E,
|
||||
) -> Result<axum::response::Response, http::StatusCode> {
|
||||
|
@ -1,6 +1,6 @@
|
||||
use async_trait::async_trait;
|
||||
use axum::extract::*;
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::Method;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use axum::{body::Body, extract::*, response::Response, routing::*};
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::{header::CONTENT_TYPE, HeaderMap, HeaderName, HeaderValue, Method, StatusCode};
|
||||
use tracing::error;
|
||||
@ -35,7 +35,7 @@ where
|
||||
.route("/complex-query-param",
|
||||
get(complex_query_param_get::<I, A, E>)
|
||||
)
|
||||
.route("/enum_in_path/:path_param",
|
||||
.route("/enum_in_path/{path_param}",
|
||||
get(enum_in_path_path_param_get::<I, A, E>)
|
||||
)
|
||||
.route("/form-test",
|
||||
@ -56,7 +56,7 @@ where
|
||||
.route("/multiget",
|
||||
get(multiget_get::<I, A, E>)
|
||||
)
|
||||
.route("/multiple-path-params-with-very-long-path-to-test-formatting/:path_param_a/:path_param_b",
|
||||
.route("/multiple-path-params-with-very-long-path-to-test-formatting/{path_param_a}/{path_param_b}",
|
||||
get(multiple_path_params_with_very_long_path_to_test_formatting_path_param_a_path_param_b_get::<I, A, E>)
|
||||
)
|
||||
.route("/multiple_auth_scheme",
|
||||
@ -83,7 +83,7 @@ where
|
||||
.route("/repos",
|
||||
post(create_repo::<I, A, E>)
|
||||
)
|
||||
.route("/repos/:repo_id",
|
||||
.route("/repos/{repo_id}",
|
||||
get(get_repo_info::<I, A, E>).get(get_repo_info::<I, A, E>)
|
||||
)
|
||||
.route("/required_octet_stream",
|
||||
|
@ -18,8 +18,8 @@ conversion = [
|
||||
|
||||
[dependencies]
|
||||
async-trait = "0.1"
|
||||
axum = "0.7"
|
||||
axum-extra = { version = "0.9", features = ["cookie", "multipart"] }
|
||||
axum = { version = "0.8", features = ["multipart"] }
|
||||
axum-extra = { version = "0.10", features = ["cookie"] }
|
||||
base64 = "0.22"
|
||||
bytes = "1"
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
|
@ -1,6 +1,6 @@
|
||||
use async_trait::async_trait;
|
||||
use axum::extract::*;
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::Method;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -8,7 +8,7 @@ pub trait ErrorHandler<E: std::fmt::Debug + Send + Sync + 'static = ()> {
|
||||
async fn handle_error(
|
||||
&self,
|
||||
method: &::http::Method,
|
||||
host: &axum::extract::Host,
|
||||
host: &axum_extra::extract::Host,
|
||||
cookies: &axum_extra::extract::CookieJar,
|
||||
error: E,
|
||||
) -> Result<axum::response::Response, http::StatusCode> {
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use axum::{body::Body, extract::*, response::Response, routing::*};
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::{header::CONTENT_TYPE, HeaderMap, HeaderName, HeaderValue, Method, StatusCode};
|
||||
use tracing::error;
|
||||
|
@ -20,8 +20,8 @@ conversion = [
|
||||
|
||||
[dependencies]
|
||||
async-trait = "0.1"
|
||||
axum = "0.7"
|
||||
axum-extra = { version = "0.9", features = ["cookie", "multipart"] }
|
||||
axum = { version = "0.8", features = ["multipart"] }
|
||||
axum-extra = { version = "0.10", features = ["cookie"] }
|
||||
base64 = "0.22"
|
||||
bytes = "1"
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
|
@ -1,6 +1,6 @@
|
||||
use async_trait::async_trait;
|
||||
use axum::extract::*;
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::Method;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -1,6 +1,6 @@
|
||||
use async_trait::async_trait;
|
||||
use axum::extract::*;
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::Method;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -1,6 +1,6 @@
|
||||
use async_trait::async_trait;
|
||||
use axum::extract::*;
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::Method;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -26,7 +26,7 @@ pub trait ErrorHandler<E: std::fmt::Debug + Send + Sync + 'static = ()> {
|
||||
async fn handle_error(
|
||||
&self,
|
||||
method: &::http::Method,
|
||||
host: &axum::extract::Host,
|
||||
host: &axum_extra::extract::Host,
|
||||
cookies: &axum_extra::extract::CookieJar,
|
||||
error: E,
|
||||
) -> Result<axum::response::Response, http::StatusCode> {
|
||||
|
@ -1,6 +1,6 @@
|
||||
use async_trait::async_trait;
|
||||
use axum::extract::*;
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::Method;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -1,6 +1,6 @@
|
||||
use async_trait::async_trait;
|
||||
use axum::extract::*;
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::Method;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -1,6 +1,6 @@
|
||||
use async_trait::async_trait;
|
||||
use axum::extract::*;
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::Method;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use axum::{body::Body, extract::*, response::Response, routing::*};
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::{header::CONTENT_TYPE, HeaderMap, HeaderName, HeaderValue, Method, StatusCode};
|
||||
use tracing::error;
|
||||
@ -46,7 +46,7 @@ where
|
||||
put(test_body_with_query_params::<I, A, E>),
|
||||
)
|
||||
.route(
|
||||
"/v2/fake/hyphenParam/:hyphen_param",
|
||||
"/v2/fake/hyphenParam/{hyphen_param}",
|
||||
get(hyphen_param::<I, A, E>),
|
||||
)
|
||||
.route(
|
||||
@ -84,33 +84,27 @@ where
|
||||
post(add_pet::<I, A, E, C>).put(update_pet::<I, A, E, C>),
|
||||
)
|
||||
.route(
|
||||
"/v2/pet/:pet_id",
|
||||
"/v2/pet/findByStatus",
|
||||
get(find_pets_by_status::<I, A, E, C>),
|
||||
)
|
||||
.route("/v2/pet/findByTags", get(find_pets_by_tags::<I, A, E, C>))
|
||||
.route(
|
||||
"/v2/pet/{pet_id}",
|
||||
delete(delete_pet::<I, A, E, C>)
|
||||
.get(get_pet_by_id::<I, A, E, C>)
|
||||
.post(update_pet_with_form::<I, A, E, C>),
|
||||
)
|
||||
.route(
|
||||
"/v2/pet/:pet_id/uploadImage",
|
||||
"/v2/pet/{pet_id}/uploadImage",
|
||||
post(upload_file::<I, A, E, C>),
|
||||
)
|
||||
.route(
|
||||
"/v2/pet/findByStatus",
|
||||
get(find_pets_by_status::<I, A, E, C>),
|
||||
)
|
||||
.route("/v2/pet/findByTags", get(find_pets_by_tags::<I, A, E, C>))
|
||||
.route("/v2/store/inventory", get(get_inventory::<I, A, E, C>))
|
||||
.route("/v2/store/order", post(place_order::<I, A, E, C>))
|
||||
.route(
|
||||
"/v2/store/order/:order_id",
|
||||
"/v2/store/order/{order_id}",
|
||||
delete(delete_order::<I, A, E, C>).get(get_order_by_id::<I, A, E, C>),
|
||||
)
|
||||
.route("/v2/user", post(create_user::<I, A, E>))
|
||||
.route(
|
||||
"/v2/user/:username",
|
||||
delete(delete_user::<I, A, E>)
|
||||
.get(get_user_by_name::<I, A, E>)
|
||||
.put(update_user::<I, A, E>),
|
||||
)
|
||||
.route(
|
||||
"/v2/user/createWithArray",
|
||||
post(create_users_with_array_input::<I, A, E>),
|
||||
@ -121,6 +115,12 @@ where
|
||||
)
|
||||
.route("/v2/user/login", get(login_user::<I, A, E>))
|
||||
.route("/v2/user/logout", get(logout_user::<I, A, E>))
|
||||
.route(
|
||||
"/v2/user/{username}",
|
||||
delete(delete_user::<I, A, E>)
|
||||
.get(get_user_by_name::<I, A, E>)
|
||||
.put(update_user::<I, A, E>),
|
||||
)
|
||||
.with_state(api_impl)
|
||||
}
|
||||
|
||||
|
@ -19,8 +19,8 @@ conversion = [
|
||||
|
||||
[dependencies]
|
||||
async-trait = "0.1"
|
||||
axum = "0.7"
|
||||
axum-extra = { version = "0.9", features = ["cookie", "multipart"] }
|
||||
axum = { version = "0.8", features = ["multipart"] }
|
||||
axum-extra = { version = "0.10", features = ["cookie"] }
|
||||
base64 = "0.22"
|
||||
bytes = "1"
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
|
@ -23,7 +23,7 @@ pub trait ErrorHandler<E: std::fmt::Debug + Send + Sync + 'static = ()> {
|
||||
async fn handle_error(
|
||||
&self,
|
||||
method: &::http::Method,
|
||||
host: &axum::extract::Host,
|
||||
host: &axum_extra::extract::Host,
|
||||
cookies: &axum_extra::extract::CookieJar,
|
||||
error: E,
|
||||
) -> Result<axum::response::Response, http::StatusCode> {
|
||||
|
@ -1,6 +1,6 @@
|
||||
use async_trait::async_trait;
|
||||
use axum::extract::*;
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::Method;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -1,6 +1,6 @@
|
||||
use async_trait::async_trait;
|
||||
use axum::extract::*;
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::Method;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -1,6 +1,6 @@
|
||||
use async_trait::async_trait;
|
||||
use axum::extract::*;
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::Method;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use axum::{body::Body, extract::*, response::Response, routing::*};
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::{header::CONTENT_TYPE, HeaderMap, HeaderName, HeaderValue, Method, StatusCode};
|
||||
use tracing::error;
|
||||
@ -33,33 +33,27 @@ where
|
||||
post(add_pet::<I, A, E, C>).put(update_pet::<I, A, E, C>),
|
||||
)
|
||||
.route(
|
||||
"/v2/pet/:pet_id",
|
||||
"/v2/pet/findByStatus",
|
||||
get(find_pets_by_status::<I, A, E, C>),
|
||||
)
|
||||
.route("/v2/pet/findByTags", get(find_pets_by_tags::<I, A, E, C>))
|
||||
.route(
|
||||
"/v2/pet/{pet_id}",
|
||||
delete(delete_pet::<I, A, E, C>)
|
||||
.get(get_pet_by_id::<I, A, E, C>)
|
||||
.post(update_pet_with_form::<I, A, E, C>),
|
||||
)
|
||||
.route(
|
||||
"/v2/pet/:pet_id/uploadImage",
|
||||
"/v2/pet/{pet_id}/uploadImage",
|
||||
post(upload_file::<I, A, E, C>),
|
||||
)
|
||||
.route(
|
||||
"/v2/pet/findByStatus",
|
||||
get(find_pets_by_status::<I, A, E, C>),
|
||||
)
|
||||
.route("/v2/pet/findByTags", get(find_pets_by_tags::<I, A, E, C>))
|
||||
.route("/v2/store/inventory", get(get_inventory::<I, A, E, C>))
|
||||
.route("/v2/store/order", post(place_order::<I, A, E, C>))
|
||||
.route(
|
||||
"/v2/store/order/:order_id",
|
||||
"/v2/store/order/{order_id}",
|
||||
delete(delete_order::<I, A, E, C>).get(get_order_by_id::<I, A, E, C>),
|
||||
)
|
||||
.route("/v2/user", post(create_user::<I, A, E, C>))
|
||||
.route(
|
||||
"/v2/user/:username",
|
||||
delete(delete_user::<I, A, E, C>)
|
||||
.get(get_user_by_name::<I, A, E, C>)
|
||||
.put(update_user::<I, A, E, C>),
|
||||
)
|
||||
.route(
|
||||
"/v2/user/createWithArray",
|
||||
post(create_users_with_array_input::<I, A, E, C>),
|
||||
@ -70,6 +64,12 @@ where
|
||||
)
|
||||
.route("/v2/user/login", get(login_user::<I, A, E, C>))
|
||||
.route("/v2/user/logout", get(logout_user::<I, A, E, C>))
|
||||
.route(
|
||||
"/v2/user/{username}",
|
||||
delete(delete_user::<I, A, E, C>)
|
||||
.get(get_user_by_name::<I, A, E, C>)
|
||||
.put(update_user::<I, A, E, C>),
|
||||
)
|
||||
.with_state(api_impl)
|
||||
}
|
||||
|
||||
|
@ -18,8 +18,8 @@ conversion = [
|
||||
|
||||
[dependencies]
|
||||
async-trait = "0.1"
|
||||
axum = "0.7"
|
||||
axum-extra = { version = "0.9", features = ["cookie", "multipart"] }
|
||||
axum = { version = "0.8", features = ["multipart"] }
|
||||
axum-extra = { version = "0.10", features = ["cookie"] }
|
||||
base64 = "0.22"
|
||||
bytes = "1"
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
|
@ -1,6 +1,6 @@
|
||||
use async_trait::async_trait;
|
||||
use axum::extract::*;
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::Method;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -8,7 +8,7 @@ pub trait ErrorHandler<E: std::fmt::Debug + Send + Sync + 'static = ()> {
|
||||
async fn handle_error(
|
||||
&self,
|
||||
method: &::http::Method,
|
||||
host: &axum::extract::Host,
|
||||
host: &axum_extra::extract::Host,
|
||||
cookies: &axum_extra::extract::CookieJar,
|
||||
error: E,
|
||||
) -> Result<axum::response::Response, http::StatusCode> {
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use axum::{body::Body, extract::*, response::Response, routing::*};
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::{header::CONTENT_TYPE, HeaderMap, HeaderName, HeaderValue, Method, StatusCode};
|
||||
use tracing::error;
|
||||
|
@ -18,8 +18,8 @@ conversion = [
|
||||
|
||||
[dependencies]
|
||||
async-trait = "0.1"
|
||||
axum = "0.7"
|
||||
axum-extra = { version = "0.9", features = ["cookie", "multipart"] }
|
||||
axum = { version = "0.8", features = ["multipart"] }
|
||||
axum-extra = { version = "0.10", features = ["cookie"] }
|
||||
base64 = "0.22"
|
||||
bytes = "1"
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
|
@ -1,6 +1,6 @@
|
||||
use async_trait::async_trait;
|
||||
use axum::extract::*;
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::Method;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -8,7 +8,7 @@ pub trait ErrorHandler<E: std::fmt::Debug + Send + Sync + 'static = ()> {
|
||||
async fn handle_error(
|
||||
&self,
|
||||
method: &::http::Method,
|
||||
host: &axum::extract::Host,
|
||||
host: &axum_extra::extract::Host,
|
||||
cookies: &axum_extra::extract::CookieJar,
|
||||
error: E,
|
||||
) -> Result<axum::response::Response, http::StatusCode> {
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use axum::{body::Body, extract::*, response::Response, routing::*};
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::{header::CONTENT_TYPE, HeaderMap, HeaderName, HeaderValue, Method, StatusCode};
|
||||
use tracing::error;
|
||||
|
@ -18,8 +18,8 @@ conversion = [
|
||||
|
||||
[dependencies]
|
||||
async-trait = "0.1"
|
||||
axum = "0.7"
|
||||
axum-extra = { version = "0.9", features = ["cookie", "multipart"] }
|
||||
axum = { version = "0.8", features = ["multipart"] }
|
||||
axum-extra = { version = "0.10", features = ["cookie"] }
|
||||
base64 = "0.22"
|
||||
bytes = "1"
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
|
@ -1,6 +1,6 @@
|
||||
use async_trait::async_trait;
|
||||
use axum::extract::*;
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::Method;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -8,7 +8,7 @@ pub trait ErrorHandler<E: std::fmt::Debug + Send + Sync + 'static = ()> {
|
||||
async fn handle_error(
|
||||
&self,
|
||||
method: &::http::Method,
|
||||
host: &axum::extract::Host,
|
||||
host: &axum_extra::extract::Host,
|
||||
cookies: &axum_extra::extract::CookieJar,
|
||||
error: E,
|
||||
) -> Result<axum::response::Response, http::StatusCode> {
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use axum::{body::Body, extract::*, response::Response, routing::*};
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::{header::CONTENT_TYPE, HeaderMap, HeaderName, HeaderValue, Method, StatusCode};
|
||||
use tracing::error;
|
||||
|
@ -18,8 +18,8 @@ conversion = [
|
||||
|
||||
[dependencies]
|
||||
async-trait = "0.1"
|
||||
axum = "0.7"
|
||||
axum-extra = { version = "0.9", features = ["cookie", "multipart"] }
|
||||
axum = { version = "0.8", features = ["multipart"] }
|
||||
axum-extra = { version = "0.10", features = ["cookie"] }
|
||||
base64 = "0.22"
|
||||
bytes = "1"
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
|
@ -1,6 +1,6 @@
|
||||
use async_trait::async_trait;
|
||||
use axum::extract::*;
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::Method;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -8,7 +8,7 @@ pub trait ErrorHandler<E: std::fmt::Debug + Send + Sync + 'static = ()> {
|
||||
async fn handle_error(
|
||||
&self,
|
||||
method: &::http::Method,
|
||||
host: &axum::extract::Host,
|
||||
host: &axum_extra::extract::Host,
|
||||
cookies: &axum_extra::extract::CookieJar,
|
||||
error: E,
|
||||
) -> Result<axum::response::Response, http::StatusCode> {
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use axum::{body::Body, extract::*, response::Response, routing::*};
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::{header::CONTENT_TYPE, HeaderMap, HeaderName, HeaderValue, Method, StatusCode};
|
||||
use tracing::error;
|
||||
|
@ -18,8 +18,8 @@ conversion = [
|
||||
|
||||
[dependencies]
|
||||
async-trait = "0.1"
|
||||
axum = "0.7"
|
||||
axum-extra = { version = "0.9", features = ["cookie", "multipart"] }
|
||||
axum = { version = "0.8", features = ["multipart"] }
|
||||
axum-extra = { version = "0.10", features = ["cookie"] }
|
||||
base64 = "0.22"
|
||||
bytes = "1"
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
|
@ -1,6 +1,6 @@
|
||||
use async_trait::async_trait;
|
||||
use axum::extract::*;
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::Method;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -8,7 +8,7 @@ pub trait ErrorHandler<E: std::fmt::Debug + Send + Sync + 'static = ()> {
|
||||
async fn handle_error(
|
||||
&self,
|
||||
method: &::http::Method,
|
||||
host: &axum::extract::Host,
|
||||
host: &axum_extra::extract::Host,
|
||||
cookies: &axum_extra::extract::CookieJar,
|
||||
error: E,
|
||||
) -> Result<axum::response::Response, http::StatusCode> {
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use axum::{body::Body, extract::*, response::Response, routing::*};
|
||||
use axum_extra::extract::{CookieJar, Multipart};
|
||||
use axum_extra::extract::{CookieJar, Host};
|
||||
use bytes::Bytes;
|
||||
use http::{header::CONTENT_TYPE, HeaderMap, HeaderName, HeaderValue, Method, StatusCode};
|
||||
use tracing::error;
|
||||
|
Loading…
x
Reference in New Issue
Block a user