diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustAxumServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustAxumServerCodegen.java index 44fccb193c1d..57cb7d9ddf6e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustAxumServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustAxumServerCodegen.java @@ -427,7 +427,7 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation 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); } diff --git a/modules/openapi-generator/src/main/resources/rust-axum/Cargo.mustache b/modules/openapi-generator/src/main/resources/rust-axum/Cargo.mustache index 56ad9103f575..ba37ecdeb0de 100644 --- a/modules/openapi-generator/src/main/resources/rust-axum/Cargo.mustache +++ b/modules/openapi-generator/src/main/resources/rust-axum/Cargo.mustache @@ -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"] } diff --git a/modules/openapi-generator/src/main/resources/rust-axum/apis-mod.mustache b/modules/openapi-generator/src/main/resources/rust-axum/apis-mod.mustache index 122aa90cb976..64afd9acb32a 100644 --- a/modules/openapi-generator/src/main/resources/rust-axum/apis-mod.mustache +++ b/modules/openapi-generator/src/main/resources/rust-axum/apis-mod.mustache @@ -37,7 +37,7 @@ pub trait ErrorHandler { 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 { @@ -47,4 +47,4 @@ pub trait ErrorHandler { .body(axum::body::Body::empty()) .map_err(|_| http::StatusCode::INTERNAL_SERVER_ERROR) } -} \ No newline at end of file +} diff --git a/modules/openapi-generator/src/main/resources/rust-axum/apis.mustache b/modules/openapi-generator/src/main/resources/rust-axum/apis.mustache index f6f69c1854a3..7bcb98eb47db 100644 --- a/modules/openapi-generator/src/main/resources/rust-axum/apis.mustache +++ b/modules/openapi-generator/src/main/resources/rust-axum/apis.mustache @@ -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}; diff --git a/modules/openapi-generator/src/main/resources/rust-axum/server-imports.mustache b/modules/openapi-generator/src/main/resources/rust-axum/server-imports.mustache index 28e323564d51..6ca3300e4f11 100644 --- a/modules/openapi-generator/src/main/resources/rust-axum/server-imports.mustache +++ b/modules/openapi-generator/src/main/resources/rust-axum/server-imports.mustache @@ -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; diff --git a/samples/server/petstore/rust-axum/output/apikey-auths/Cargo.toml b/samples/server/petstore/rust-axum/output/apikey-auths/Cargo.toml index 9f5dc9ccc8eb..d99bd53b1fe3 100644 --- a/samples/server/petstore/rust-axum/output/apikey-auths/Cargo.toml +++ b/samples/server/petstore/rust-axum/output/apikey-auths/Cargo.toml @@ -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"] } diff --git a/samples/server/petstore/rust-axum/output/apikey-auths/src/apis/mod.rs b/samples/server/petstore/rust-axum/output/apikey-auths/src/apis/mod.rs index b411dafe544a..cb001b59d6a1 100644 --- a/samples/server/petstore/rust-axum/output/apikey-auths/src/apis/mod.rs +++ b/samples/server/petstore/rust-axum/output/apikey-auths/src/apis/mod.rs @@ -33,7 +33,7 @@ pub trait ErrorHandler { 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 { diff --git a/samples/server/petstore/rust-axum/output/apikey-auths/src/apis/payments.rs b/samples/server/petstore/rust-axum/output/apikey-auths/src/apis/payments.rs index 01c97e2874c5..5bff9b674790 100644 --- a/samples/server/petstore/rust-axum/output/apikey-auths/src/apis/payments.rs +++ b/samples/server/petstore/rust-axum/output/apikey-auths/src/apis/payments.rs @@ -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}; diff --git a/samples/server/petstore/rust-axum/output/apikey-auths/src/server/mod.rs b/samples/server/petstore/rust-axum/output/apikey-auths/src/server/mod.rs index 46899c5f2539..a55fa2b18bda 100644 --- a/samples/server/petstore/rust-axum/output/apikey-auths/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/apikey-auths/src/server/mod.rs @@ -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::), ) .route( - "/v71/paymentMethods/:id", + "/v71/paymentMethods/{id}", get(get_payment_method_by_id::), ) .route("/v71/payments", post(post_make_payment::)) diff --git a/samples/server/petstore/rust-axum/output/multipart-v3/Cargo.toml b/samples/server/petstore/rust-axum/output/multipart-v3/Cargo.toml index 14a77bf61a09..9b19309ec211 100644 --- a/samples/server/petstore/rust-axum/output/multipart-v3/Cargo.toml +++ b/samples/server/petstore/rust-axum/output/multipart-v3/Cargo.toml @@ -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"] } diff --git a/samples/server/petstore/rust-axum/output/multipart-v3/src/apis/default.rs b/samples/server/petstore/rust-axum/output/multipart-v3/src/apis/default.rs index ff1e7b6353d7..84c0c79e9544 100644 --- a/samples/server/petstore/rust-axum/output/multipart-v3/src/apis/default.rs +++ b/samples/server/petstore/rust-axum/output/multipart-v3/src/apis/default.rs @@ -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}; diff --git a/samples/server/petstore/rust-axum/output/multipart-v3/src/apis/mod.rs b/samples/server/petstore/rust-axum/output/multipart-v3/src/apis/mod.rs index 189958193a59..be654b5f14ce 100644 --- a/samples/server/petstore/rust-axum/output/multipart-v3/src/apis/mod.rs +++ b/samples/server/petstore/rust-axum/output/multipart-v3/src/apis/mod.rs @@ -8,7 +8,7 @@ pub trait ErrorHandler { 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 { diff --git a/samples/server/petstore/rust-axum/output/multipart-v3/src/server/mod.rs b/samples/server/petstore/rust-axum/output/multipart-v3/src/server/mod.rs index 5deba8406f0c..e098a8c29b08 100644 --- a/samples/server/petstore/rust-axum/output/multipart-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/multipart-v3/src/server/mod.rs @@ -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; diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/Cargo.toml b/samples/server/petstore/rust-axum/output/openapi-v3/Cargo.toml index 8ca134992a3b..5dd596ed3f60 100644 --- a/samples/server/petstore/rust-axum/output/openapi-v3/Cargo.toml +++ b/samples/server/petstore/rust-axum/output/openapi-v3/Cargo.toml @@ -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"] } diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/default.rs b/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/default.rs index 1e7c5186c981..65b74d4a39c5 100644 --- a/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/default.rs +++ b/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/default.rs @@ -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}; diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/info_repo.rs b/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/info_repo.rs index 116f1283534f..822576c53466 100644 --- a/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/info_repo.rs +++ b/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/info_repo.rs @@ -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}; diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/mod.rs b/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/mod.rs index 8d27762fd6d9..134b27873bfb 100644 --- a/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/mod.rs +++ b/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/mod.rs @@ -10,7 +10,7 @@ pub trait ErrorHandler { 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 { diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/repo.rs b/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/repo.rs index d66414a5f9ef..f3c5c204493d 100644 --- a/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/repo.rs +++ b/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/repo.rs @@ -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}; diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/src/server/mod.rs b/samples/server/petstore/rust-axum/output/openapi-v3/src/server/mod.rs index 3cf9e4a70bfa..fd17b920227a 100644 --- a/samples/server/petstore/rust-axum/output/openapi-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/openapi-v3/src/server/mod.rs @@ -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::) ) - .route("/enum_in_path/:path_param", + .route("/enum_in_path/{path_param}", get(enum_in_path_path_param_get::) ) .route("/form-test", @@ -56,7 +56,7 @@ where .route("/multiget", get(multiget_get::) ) - .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::) ) .route("/multiple_auth_scheme", @@ -83,7 +83,7 @@ where .route("/repos", post(create_repo::) ) - .route("/repos/:repo_id", + .route("/repos/{repo_id}", get(get_repo_info::).get(get_repo_info::) ) .route("/required_octet_stream", diff --git a/samples/server/petstore/rust-axum/output/ops-v3/Cargo.toml b/samples/server/petstore/rust-axum/output/ops-v3/Cargo.toml index 593a385ae810..b4cb37fab58a 100644 --- a/samples/server/petstore/rust-axum/output/ops-v3/Cargo.toml +++ b/samples/server/petstore/rust-axum/output/ops-v3/Cargo.toml @@ -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"] } diff --git a/samples/server/petstore/rust-axum/output/ops-v3/src/apis/default.rs b/samples/server/petstore/rust-axum/output/ops-v3/src/apis/default.rs index 300e1e48e8b5..f82fc8ea9707 100644 --- a/samples/server/petstore/rust-axum/output/ops-v3/src/apis/default.rs +++ b/samples/server/petstore/rust-axum/output/ops-v3/src/apis/default.rs @@ -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}; diff --git a/samples/server/petstore/rust-axum/output/ops-v3/src/apis/mod.rs b/samples/server/petstore/rust-axum/output/ops-v3/src/apis/mod.rs index 189958193a59..be654b5f14ce 100644 --- a/samples/server/petstore/rust-axum/output/ops-v3/src/apis/mod.rs +++ b/samples/server/petstore/rust-axum/output/ops-v3/src/apis/mod.rs @@ -8,7 +8,7 @@ pub trait ErrorHandler { 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 { diff --git a/samples/server/petstore/rust-axum/output/ops-v3/src/server/mod.rs b/samples/server/petstore/rust-axum/output/ops-v3/src/server/mod.rs index c27bd65a859b..f1658b2cc69c 100644 --- a/samples/server/petstore/rust-axum/output/ops-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/ops-v3/src/server/mod.rs @@ -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; diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml index bb08b714ed11..ea81193f6c5e 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml @@ -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"] } diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/another_fake.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/another_fake.rs index 0594b1698397..f3a796904b3d 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/another_fake.rs +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/another_fake.rs @@ -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}; diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/fake.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/fake.rs index 86c3f00a5637..3baac16a6e52 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/fake.rs +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/fake.rs @@ -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}; diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/fake_classname_tags123.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/fake_classname_tags123.rs index 95b565f4203d..4987f71681ea 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/fake_classname_tags123.rs +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/fake_classname_tags123.rs @@ -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}; diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/mod.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/mod.rs index 0b10eed0b611..a8a2d0c7550d 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/mod.rs +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/mod.rs @@ -26,7 +26,7 @@ pub trait ErrorHandler { 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 { diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/pet.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/pet.rs index 62f4fa27b493..c7f7c19f1809 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/pet.rs +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/pet.rs @@ -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}; diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/store.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/store.rs index 9ceedb0f32c7..c53e0608da9c 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/store.rs +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/store.rs @@ -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}; diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/user.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/user.rs index bb42e89a031e..1c68461fdf67 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/user.rs +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/user.rs @@ -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}; diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs index 9eedd8a6d0b2..a02a906a80d2 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs @@ -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::), ) .route( - "/v2/fake/hyphenParam/:hyphen_param", + "/v2/fake/hyphenParam/{hyphen_param}", get(hyphen_param::), ) .route( @@ -84,33 +84,27 @@ where post(add_pet::).put(update_pet::), ) .route( - "/v2/pet/:pet_id", + "/v2/pet/findByStatus", + get(find_pets_by_status::), + ) + .route("/v2/pet/findByTags", get(find_pets_by_tags::)) + .route( + "/v2/pet/{pet_id}", delete(delete_pet::) .get(get_pet_by_id::) .post(update_pet_with_form::), ) .route( - "/v2/pet/:pet_id/uploadImage", + "/v2/pet/{pet_id}/uploadImage", post(upload_file::), ) - .route( - "/v2/pet/findByStatus", - get(find_pets_by_status::), - ) - .route("/v2/pet/findByTags", get(find_pets_by_tags::)) .route("/v2/store/inventory", get(get_inventory::)) .route("/v2/store/order", post(place_order::)) .route( - "/v2/store/order/:order_id", + "/v2/store/order/{order_id}", delete(delete_order::).get(get_order_by_id::), ) .route("/v2/user", post(create_user::)) - .route( - "/v2/user/:username", - delete(delete_user::) - .get(get_user_by_name::) - .put(update_user::), - ) .route( "/v2/user/createWithArray", post(create_users_with_array_input::), @@ -121,6 +115,12 @@ where ) .route("/v2/user/login", get(login_user::)) .route("/v2/user/logout", get(logout_user::)) + .route( + "/v2/user/{username}", + delete(delete_user::) + .get(get_user_by_name::) + .put(update_user::), + ) .with_state(api_impl) } diff --git a/samples/server/petstore/rust-axum/output/petstore/Cargo.toml b/samples/server/petstore/rust-axum/output/petstore/Cargo.toml index e2f53672a539..3486b3a99ca2 100644 --- a/samples/server/petstore/rust-axum/output/petstore/Cargo.toml +++ b/samples/server/petstore/rust-axum/output/petstore/Cargo.toml @@ -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"] } diff --git a/samples/server/petstore/rust-axum/output/petstore/src/apis/mod.rs b/samples/server/petstore/rust-axum/output/petstore/src/apis/mod.rs index b3bea180cfde..2710cd128b63 100644 --- a/samples/server/petstore/rust-axum/output/petstore/src/apis/mod.rs +++ b/samples/server/petstore/rust-axum/output/petstore/src/apis/mod.rs @@ -23,7 +23,7 @@ pub trait ErrorHandler { 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 { diff --git a/samples/server/petstore/rust-axum/output/petstore/src/apis/pet.rs b/samples/server/petstore/rust-axum/output/petstore/src/apis/pet.rs index a3cf82acb948..aedef6a80c77 100644 --- a/samples/server/petstore/rust-axum/output/petstore/src/apis/pet.rs +++ b/samples/server/petstore/rust-axum/output/petstore/src/apis/pet.rs @@ -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}; diff --git a/samples/server/petstore/rust-axum/output/petstore/src/apis/store.rs b/samples/server/petstore/rust-axum/output/petstore/src/apis/store.rs index bc8b22fcddc3..d564986ceaf1 100644 --- a/samples/server/petstore/rust-axum/output/petstore/src/apis/store.rs +++ b/samples/server/petstore/rust-axum/output/petstore/src/apis/store.rs @@ -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}; diff --git a/samples/server/petstore/rust-axum/output/petstore/src/apis/user.rs b/samples/server/petstore/rust-axum/output/petstore/src/apis/user.rs index 91e30ee7637c..5bf728968880 100644 --- a/samples/server/petstore/rust-axum/output/petstore/src/apis/user.rs +++ b/samples/server/petstore/rust-axum/output/petstore/src/apis/user.rs @@ -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}; diff --git a/samples/server/petstore/rust-axum/output/petstore/src/server/mod.rs b/samples/server/petstore/rust-axum/output/petstore/src/server/mod.rs index e143adb5f88c..9fba7852109b 100644 --- a/samples/server/petstore/rust-axum/output/petstore/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/petstore/src/server/mod.rs @@ -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::).put(update_pet::), ) .route( - "/v2/pet/:pet_id", + "/v2/pet/findByStatus", + get(find_pets_by_status::), + ) + .route("/v2/pet/findByTags", get(find_pets_by_tags::)) + .route( + "/v2/pet/{pet_id}", delete(delete_pet::) .get(get_pet_by_id::) .post(update_pet_with_form::), ) .route( - "/v2/pet/:pet_id/uploadImage", + "/v2/pet/{pet_id}/uploadImage", post(upload_file::), ) - .route( - "/v2/pet/findByStatus", - get(find_pets_by_status::), - ) - .route("/v2/pet/findByTags", get(find_pets_by_tags::)) .route("/v2/store/inventory", get(get_inventory::)) .route("/v2/store/order", post(place_order::)) .route( - "/v2/store/order/:order_id", + "/v2/store/order/{order_id}", delete(delete_order::).get(get_order_by_id::), ) .route("/v2/user", post(create_user::)) - .route( - "/v2/user/:username", - delete(delete_user::) - .get(get_user_by_name::) - .put(update_user::), - ) .route( "/v2/user/createWithArray", post(create_users_with_array_input::), @@ -70,6 +64,12 @@ where ) .route("/v2/user/login", get(login_user::)) .route("/v2/user/logout", get(logout_user::)) + .route( + "/v2/user/{username}", + delete(delete_user::) + .get(get_user_by_name::) + .put(update_user::), + ) .with_state(api_impl) } diff --git a/samples/server/petstore/rust-axum/output/ping-bearer-auth/Cargo.toml b/samples/server/petstore/rust-axum/output/ping-bearer-auth/Cargo.toml index 0ef3a0b7a976..6881b23a29d2 100644 --- a/samples/server/petstore/rust-axum/output/ping-bearer-auth/Cargo.toml +++ b/samples/server/petstore/rust-axum/output/ping-bearer-auth/Cargo.toml @@ -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"] } diff --git a/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/apis/default.rs b/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/apis/default.rs index 7e86a4c6713c..d35c79e55408 100644 --- a/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/apis/default.rs +++ b/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/apis/default.rs @@ -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}; diff --git a/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/apis/mod.rs b/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/apis/mod.rs index 189958193a59..be654b5f14ce 100644 --- a/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/apis/mod.rs +++ b/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/apis/mod.rs @@ -8,7 +8,7 @@ pub trait ErrorHandler { 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 { diff --git a/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/server/mod.rs b/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/server/mod.rs index 6cc123686069..579474fa03aa 100644 --- a/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/server/mod.rs @@ -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; diff --git a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/Cargo.toml b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/Cargo.toml index 61a1be517f9b..dc3fc8fbb866 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/Cargo.toml +++ b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/Cargo.toml @@ -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"] } diff --git a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/apis/default.rs b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/apis/default.rs index c2d71af1d828..f6a1555ba92c 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/apis/default.rs +++ b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/apis/default.rs @@ -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}; diff --git a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/apis/mod.rs b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/apis/mod.rs index 189958193a59..be654b5f14ce 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/apis/mod.rs +++ b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/apis/mod.rs @@ -8,7 +8,7 @@ pub trait ErrorHandler { 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 { diff --git a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/server/mod.rs b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/server/mod.rs index 4c13730cf906..bb933d9d6ce0 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/server/mod.rs @@ -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; diff --git a/samples/server/petstore/rust-axum/output/rust-axum-oneof/Cargo.toml b/samples/server/petstore/rust-axum/output/rust-axum-oneof/Cargo.toml index 6f1c1537e730..fc3aaa306ddf 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-oneof/Cargo.toml +++ b/samples/server/petstore/rust-axum/output/rust-axum-oneof/Cargo.toml @@ -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"] } diff --git a/samples/server/petstore/rust-axum/output/rust-axum-oneof/src/apis/default.rs b/samples/server/petstore/rust-axum/output/rust-axum-oneof/src/apis/default.rs index dd9fae3277fb..bd39840e27c9 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-oneof/src/apis/default.rs +++ b/samples/server/petstore/rust-axum/output/rust-axum-oneof/src/apis/default.rs @@ -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}; diff --git a/samples/server/petstore/rust-axum/output/rust-axum-oneof/src/apis/mod.rs b/samples/server/petstore/rust-axum/output/rust-axum-oneof/src/apis/mod.rs index 189958193a59..be654b5f14ce 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-oneof/src/apis/mod.rs +++ b/samples/server/petstore/rust-axum/output/rust-axum-oneof/src/apis/mod.rs @@ -8,7 +8,7 @@ pub trait ErrorHandler { 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 { diff --git a/samples/server/petstore/rust-axum/output/rust-axum-oneof/src/server/mod.rs b/samples/server/petstore/rust-axum/output/rust-axum-oneof/src/server/mod.rs index 31e7d18306f7..5ebf7f1f7bf1 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-oneof/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/rust-axum-oneof/src/server/mod.rs @@ -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; diff --git a/samples/server/petstore/rust-axum/output/rust-axum-test/Cargo.toml b/samples/server/petstore/rust-axum/output/rust-axum-test/Cargo.toml index e5673ab75676..cb26009936a9 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-test/Cargo.toml +++ b/samples/server/petstore/rust-axum/output/rust-axum-test/Cargo.toml @@ -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"] } diff --git a/samples/server/petstore/rust-axum/output/rust-axum-test/src/apis/default.rs b/samples/server/petstore/rust-axum/output/rust-axum-test/src/apis/default.rs index 914ccacd9708..a4f22925474e 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-test/src/apis/default.rs +++ b/samples/server/petstore/rust-axum/output/rust-axum-test/src/apis/default.rs @@ -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}; diff --git a/samples/server/petstore/rust-axum/output/rust-axum-test/src/apis/mod.rs b/samples/server/petstore/rust-axum/output/rust-axum-test/src/apis/mod.rs index 189958193a59..be654b5f14ce 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-test/src/apis/mod.rs +++ b/samples/server/petstore/rust-axum/output/rust-axum-test/src/apis/mod.rs @@ -8,7 +8,7 @@ pub trait ErrorHandler { 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 { diff --git a/samples/server/petstore/rust-axum/output/rust-axum-test/src/server/mod.rs b/samples/server/petstore/rust-axum/output/rust-axum-test/src/server/mod.rs index 344af2c02581..a12cfd64478b 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-test/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/rust-axum-test/src/server/mod.rs @@ -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; diff --git a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/Cargo.toml b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/Cargo.toml index f4a38c11157a..0d1de6020337 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/Cargo.toml +++ b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/Cargo.toml @@ -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"] } diff --git a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/apis/default.rs b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/apis/default.rs index 99614283bc48..7f26aebebd61 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/apis/default.rs +++ b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/apis/default.rs @@ -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}; diff --git a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/apis/mod.rs b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/apis/mod.rs index 189958193a59..be654b5f14ce 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/apis/mod.rs +++ b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/apis/mod.rs @@ -8,7 +8,7 @@ pub trait ErrorHandler { 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 { diff --git a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/server/mod.rs b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/server/mod.rs index 55d30ae25f9b..4f7e9afac62d 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/server/mod.rs @@ -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;