diff --git a/bin/utils/test_file_list.yaml b/bin/utils/test_file_list.yaml index 3e224f97d191..735f2821f9b4 100644 --- a/bin/utils/test_file_list.yaml +++ b/bin/utils/test_file_list.yaml @@ -50,7 +50,7 @@ - filename: "samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ZebraTest.java" sha256: 15eeb6d8a9a79d0f1930b861540d9c5780d6c49ea4fdb68269ac3e7ec481e142 # rust axum test files -- filename: "samples/server/petstore/rust-axum/output/rust-axum-oneof/src/tests.rs" - sha256: 3d4198174018cc7fd9d4bcffd950609a5bd306cf03b2fa780516f4e22a566e8c -- filename: "samples/server/petstore/rust-axum/output/openapi-v3/src/tests.rs" - sha256: 356ac684b1fce91b153c63caefc1fe7472ea600ac436a19631e16bc00e986c50 +- filename: "samples/server/petstore/rust-axum/output/rust-axum-oneof/tests/oneof_with_discriminator.rs" + sha256: 2d4f5a069fdcb3057bb078d5e75b3de63cd477b97725e457079df24bd2c30600 +- filename: "samples/server/petstore/rust-axum/output/openapi-v3/tests/oneof_untagged.rs" + sha256: e72fbf81a9849dc7abb7e2169f2fc355c8b1cf991c0e2ffc083126abd9e966e7 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 79ea15e5b882..44fccb193c1d 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 @@ -236,8 +236,6 @@ public RustAxumServerCodegen() { supportingFiles.add(new SupportingFile("header.mustache", "src", "header.rs")); supportingFiles.add(new SupportingFile("server-mod.mustache", "src/server", "mod.rs")); supportingFiles.add(new SupportingFile("apis-mod.mustache", apiPackage().replace('.', File.separatorChar), "mod.rs")); - // The file gets overwritten regardless - supportingFiles.add(new SupportingFile("tests.mustache", "src", "tests.rs").doNotOverwrite()); supportingFiles.add(new SupportingFile("README.mustache", "", "README.md").doNotOverwrite()); } diff --git a/modules/openapi-generator/src/main/resources/rust-axum/lib.mustache b/modules/openapi-generator/src/main/resources/rust-axum/lib.mustache index 98b6bc99145a..7f197ef5f0ff 100644 --- a/modules/openapi-generator/src/main/resources/rust-axum/lib.mustache +++ b/modules/openapi-generator/src/main/resources/rust-axum/lib.mustache @@ -28,6 +28,3 @@ pub mod apis; #[cfg(feature = "server")] pub(crate) mod header; - -#[cfg(test)] -mod tests; diff --git a/modules/openapi-generator/src/main/resources/rust-axum/tests.mustache b/modules/openapi-generator/src/main/resources/rust-axum/tests.mustache deleted file mode 100644 index 3a811047352f..000000000000 --- a/modules/openapi-generator/src/main/resources/rust-axum/tests.mustache +++ /dev/null @@ -1,9 +0,0 @@ -#[test] -fn std_test() { - assert!(true); -} - -#[tokio::test] -async fn tokio_test() { - assert!(true); -} diff --git a/samples/server/petstore/rust-axum/output/apikey-auths/.openapi-generator/FILES b/samples/server/petstore/rust-axum/output/apikey-auths/.openapi-generator/FILES index d511a90a1573..282f205d1167 100644 --- a/samples/server/petstore/rust-axum/output/apikey-auths/.openapi-generator/FILES +++ b/samples/server/petstore/rust-axum/output/apikey-auths/.openapi-generator/FILES @@ -7,5 +7,4 @@ src/header.rs src/lib.rs src/models.rs src/server/mod.rs -src/tests.rs src/types.rs diff --git a/samples/server/petstore/rust-axum/output/apikey-auths/src/lib.rs b/samples/server/petstore/rust-axum/output/apikey-auths/src/lib.rs index 9c4ee6594d97..d461afebe02e 100644 --- a/samples/server/petstore/rust-axum/output/apikey-auths/src/lib.rs +++ b/samples/server/petstore/rust-axum/output/apikey-auths/src/lib.rs @@ -26,6 +26,3 @@ pub mod types; #[cfg(feature = "server")] pub(crate) mod header; - -#[cfg(test)] -mod tests; diff --git a/samples/server/petstore/rust-axum/output/apikey-auths/src/tests.rs b/samples/server/petstore/rust-axum/output/apikey-auths/src/tests.rs deleted file mode 100644 index 3a811047352f..000000000000 --- a/samples/server/petstore/rust-axum/output/apikey-auths/src/tests.rs +++ /dev/null @@ -1,9 +0,0 @@ -#[test] -fn std_test() { - assert!(true); -} - -#[tokio::test] -async fn tokio_test() { - assert!(true); -} diff --git a/samples/server/petstore/rust-axum/output/multipart-v3/.openapi-generator/FILES b/samples/server/petstore/rust-axum/output/multipart-v3/.openapi-generator/FILES index 47de4e6caefd..683914c4c643 100644 --- a/samples/server/petstore/rust-axum/output/multipart-v3/.openapi-generator/FILES +++ b/samples/server/petstore/rust-axum/output/multipart-v3/.openapi-generator/FILES @@ -7,5 +7,4 @@ src/header.rs src/lib.rs src/models.rs src/server/mod.rs -src/tests.rs src/types.rs diff --git a/samples/server/petstore/rust-axum/output/multipart-v3/src/lib.rs b/samples/server/petstore/rust-axum/output/multipart-v3/src/lib.rs index ebfcd1448c3f..cc053adc1ca5 100644 --- a/samples/server/petstore/rust-axum/output/multipart-v3/src/lib.rs +++ b/samples/server/petstore/rust-axum/output/multipart-v3/src/lib.rs @@ -26,6 +26,3 @@ pub mod types; #[cfg(feature = "server")] pub(crate) mod header; - -#[cfg(test)] -mod tests; diff --git a/samples/server/petstore/rust-axum/output/multipart-v3/src/tests.rs b/samples/server/petstore/rust-axum/output/multipart-v3/src/tests.rs deleted file mode 100644 index 3a811047352f..000000000000 --- a/samples/server/petstore/rust-axum/output/multipart-v3/src/tests.rs +++ /dev/null @@ -1,9 +0,0 @@ -#[test] -fn std_test() { - assert!(true); -} - -#[tokio::test] -async fn tokio_test() { - assert!(true); -} diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/.openapi-generator/FILES b/samples/server/petstore/rust-axum/output/openapi-v3/.openapi-generator/FILES index 9b02e1fdc236..2c6783a8355b 100644 --- a/samples/server/petstore/rust-axum/output/openapi-v3/.openapi-generator/FILES +++ b/samples/server/petstore/rust-axum/output/openapi-v3/.openapi-generator/FILES @@ -9,5 +9,4 @@ src/header.rs src/lib.rs src/models.rs src/server/mod.rs -src/tests.rs src/types.rs diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/src/lib.rs b/samples/server/petstore/rust-axum/output/openapi-v3/src/lib.rs index ebfcd1448c3f..cc053adc1ca5 100644 --- a/samples/server/petstore/rust-axum/output/openapi-v3/src/lib.rs +++ b/samples/server/petstore/rust-axum/output/openapi-v3/src/lib.rs @@ -26,6 +26,3 @@ pub mod types; #[cfg(feature = "server")] pub(crate) mod header; - -#[cfg(test)] -mod tests; diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/src/tests.rs b/samples/server/petstore/rust-axum/output/openapi-v3/tests/oneof_untagged.rs similarity index 90% rename from samples/server/petstore/rust-axum/output/openapi-v3/src/tests.rs rename to samples/server/petstore/rust-axum/output/openapi-v3/tests/oneof_untagged.rs index f0c221ea431e..63c04df4913f 100644 --- a/samples/server/petstore/rust-axum/output/openapi-v3/src/tests.rs +++ b/samples/server/petstore/rust-axum/output/openapi-v3/tests/oneof_untagged.rs @@ -1,7 +1,7 @@ +use openapi_v3::models::OneOfGet200Response; + #[test] fn test_oneof_schema_untagged() { - use crate::models::OneOfGet200Response; - #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] struct Test { value: OneOfGet200Response, @@ -34,8 +34,3 @@ fn test_oneof_schema_untagged() { test6 ); } - -#[tokio::test] -async fn tokio_test() { - assert!(true); -} diff --git a/samples/server/petstore/rust-axum/output/ops-v3/.openapi-generator/FILES b/samples/server/petstore/rust-axum/output/ops-v3/.openapi-generator/FILES index 47de4e6caefd..683914c4c643 100644 --- a/samples/server/petstore/rust-axum/output/ops-v3/.openapi-generator/FILES +++ b/samples/server/petstore/rust-axum/output/ops-v3/.openapi-generator/FILES @@ -7,5 +7,4 @@ src/header.rs src/lib.rs src/models.rs src/server/mod.rs -src/tests.rs src/types.rs diff --git a/samples/server/petstore/rust-axum/output/ops-v3/src/lib.rs b/samples/server/petstore/rust-axum/output/ops-v3/src/lib.rs index 788f8dbd060b..bfdd7c899236 100644 --- a/samples/server/petstore/rust-axum/output/ops-v3/src/lib.rs +++ b/samples/server/petstore/rust-axum/output/ops-v3/src/lib.rs @@ -26,6 +26,3 @@ pub mod types; #[cfg(feature = "server")] pub(crate) mod header; - -#[cfg(test)] -mod tests; diff --git a/samples/server/petstore/rust-axum/output/ops-v3/src/tests.rs b/samples/server/petstore/rust-axum/output/ops-v3/src/tests.rs deleted file mode 100644 index 3a811047352f..000000000000 --- a/samples/server/petstore/rust-axum/output/ops-v3/src/tests.rs +++ /dev/null @@ -1,9 +0,0 @@ -#[test] -fn std_test() { - assert!(true); -} - -#[tokio::test] -async fn tokio_test() { - assert!(true); -} diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/FILES b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/FILES index 95528256a329..c4774ff1a7cc 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/FILES +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/FILES @@ -12,5 +12,4 @@ src/header.rs src/lib.rs src/models.rs src/server/mod.rs -src/tests.rs src/types.rs diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs index ffffb88b1927..91d8f87a36a8 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs @@ -26,6 +26,3 @@ pub mod types; #[cfg(feature = "server")] pub(crate) mod header; - -#[cfg(test)] -mod tests; diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/tests.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/tests.rs deleted file mode 100644 index 3a811047352f..000000000000 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/tests.rs +++ /dev/null @@ -1,9 +0,0 @@ -#[test] -fn std_test() { - assert!(true); -} - -#[tokio::test] -async fn tokio_test() { - assert!(true); -} diff --git a/samples/server/petstore/rust-axum/output/petstore/.openapi-generator/FILES b/samples/server/petstore/rust-axum/output/petstore/.openapi-generator/FILES index fdeb33c57d16..2520d7516ecb 100644 --- a/samples/server/petstore/rust-axum/output/petstore/.openapi-generator/FILES +++ b/samples/server/petstore/rust-axum/output/petstore/.openapi-generator/FILES @@ -9,5 +9,4 @@ src/header.rs src/lib.rs src/models.rs src/server/mod.rs -src/tests.rs src/types.rs diff --git a/samples/server/petstore/rust-axum/output/petstore/src/lib.rs b/samples/server/petstore/rust-axum/output/petstore/src/lib.rs index ffffb88b1927..91d8f87a36a8 100644 --- a/samples/server/petstore/rust-axum/output/petstore/src/lib.rs +++ b/samples/server/petstore/rust-axum/output/petstore/src/lib.rs @@ -26,6 +26,3 @@ pub mod types; #[cfg(feature = "server")] pub(crate) mod header; - -#[cfg(test)] -mod tests; diff --git a/samples/server/petstore/rust-axum/output/petstore/src/tests.rs b/samples/server/petstore/rust-axum/output/petstore/src/tests.rs deleted file mode 100644 index 3a811047352f..000000000000 --- a/samples/server/petstore/rust-axum/output/petstore/src/tests.rs +++ /dev/null @@ -1,9 +0,0 @@ -#[test] -fn std_test() { - assert!(true); -} - -#[tokio::test] -async fn tokio_test() { - assert!(true); -} diff --git a/samples/server/petstore/rust-axum/output/ping-bearer-auth/.openapi-generator/FILES b/samples/server/petstore/rust-axum/output/ping-bearer-auth/.openapi-generator/FILES index 47de4e6caefd..683914c4c643 100644 --- a/samples/server/petstore/rust-axum/output/ping-bearer-auth/.openapi-generator/FILES +++ b/samples/server/petstore/rust-axum/output/ping-bearer-auth/.openapi-generator/FILES @@ -7,5 +7,4 @@ src/header.rs src/lib.rs src/models.rs src/server/mod.rs -src/tests.rs src/types.rs diff --git a/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/lib.rs b/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/lib.rs index 75b135c4513e..127b67da835e 100644 --- a/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/lib.rs +++ b/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/lib.rs @@ -26,6 +26,3 @@ pub mod types; #[cfg(feature = "server")] pub(crate) mod header; - -#[cfg(test)] -mod tests; diff --git a/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/tests.rs b/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/tests.rs deleted file mode 100644 index 3a811047352f..000000000000 --- a/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/tests.rs +++ /dev/null @@ -1,9 +0,0 @@ -#[test] -fn std_test() { - assert!(true); -} - -#[tokio::test] -async fn tokio_test() { - assert!(true); -} diff --git a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/.openapi-generator/FILES b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/.openapi-generator/FILES index 47de4e6caefd..683914c4c643 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/.openapi-generator/FILES +++ b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/.openapi-generator/FILES @@ -7,5 +7,4 @@ src/header.rs src/lib.rs src/models.rs src/server/mod.rs -src/tests.rs src/types.rs diff --git a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/lib.rs b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/lib.rs index 05c534e28424..7f6af70e59f7 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/lib.rs +++ b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/lib.rs @@ -26,6 +26,3 @@ pub mod types; #[cfg(feature = "server")] pub(crate) mod header; - -#[cfg(test)] -mod tests; diff --git a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/tests.rs b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/tests.rs deleted file mode 100644 index 3a811047352f..000000000000 --- a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/tests.rs +++ /dev/null @@ -1,9 +0,0 @@ -#[test] -fn std_test() { - assert!(true); -} - -#[tokio::test] -async fn tokio_test() { - assert!(true); -} diff --git a/samples/server/petstore/rust-axum/output/rust-axum-oneof/.openapi-generator/FILES b/samples/server/petstore/rust-axum/output/rust-axum-oneof/.openapi-generator/FILES index 47de4e6caefd..683914c4c643 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-oneof/.openapi-generator/FILES +++ b/samples/server/petstore/rust-axum/output/rust-axum-oneof/.openapi-generator/FILES @@ -7,5 +7,4 @@ src/header.rs src/lib.rs src/models.rs src/server/mod.rs -src/tests.rs src/types.rs diff --git a/samples/server/petstore/rust-axum/output/rust-axum-oneof/src/lib.rs b/samples/server/petstore/rust-axum/output/rust-axum-oneof/src/lib.rs index 788f8dbd060b..bfdd7c899236 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-oneof/src/lib.rs +++ b/samples/server/petstore/rust-axum/output/rust-axum-oneof/src/lib.rs @@ -26,6 +26,3 @@ pub mod types; #[cfg(feature = "server")] pub(crate) mod header; - -#[cfg(test)] -mod tests; diff --git a/samples/server/petstore/rust-axum/output/rust-axum-oneof/src/tests.rs b/samples/server/petstore/rust-axum/output/rust-axum-oneof/tests/oneof_with_discriminator.rs similarity index 97% rename from samples/server/petstore/rust-axum/output/rust-axum-oneof/src/tests.rs rename to samples/server/petstore/rust-axum/output/rust-axum-oneof/tests/oneof_with_discriminator.rs index aa3cfff54899..95d99b0a5578 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-oneof/src/tests.rs +++ b/samples/server/petstore/rust-axum/output/rust-axum-oneof/tests/oneof_with_discriminator.rs @@ -1,7 +1,7 @@ +use rust_axum_oneof::models::*; + #[test] fn test_oneof_schema_with_discriminator() { - use crate::models::*; - let test0 = r#"{"op": "ignored", "d": {"welcome_message": "test0"}}"#; let test1 = r#"{"op": "Hello", "d": {"welcome_message": "test1"}}"#; @@ -94,8 +94,3 @@ fn test_oneof_schema_with_discriminator() { test15 ); } - -#[tokio::test] -async fn tokio_test() { - assert!(true); -} diff --git a/samples/server/petstore/rust-axum/output/rust-axum-test/.openapi-generator/FILES b/samples/server/petstore/rust-axum/output/rust-axum-test/.openapi-generator/FILES index 47de4e6caefd..683914c4c643 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-test/.openapi-generator/FILES +++ b/samples/server/petstore/rust-axum/output/rust-axum-test/.openapi-generator/FILES @@ -7,5 +7,4 @@ src/header.rs src/lib.rs src/models.rs src/server/mod.rs -src/tests.rs src/types.rs diff --git a/samples/server/petstore/rust-axum/output/rust-axum-test/src/lib.rs b/samples/server/petstore/rust-axum/output/rust-axum-test/src/lib.rs index 17d18b59d83a..d9085fbe8b9b 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-test/src/lib.rs +++ b/samples/server/petstore/rust-axum/output/rust-axum-test/src/lib.rs @@ -26,6 +26,3 @@ pub mod types; #[cfg(feature = "server")] pub(crate) mod header; - -#[cfg(test)] -mod tests; diff --git a/samples/server/petstore/rust-axum/output/rust-axum-test/src/tests.rs b/samples/server/petstore/rust-axum/output/rust-axum-test/src/tests.rs deleted file mode 100644 index 3a811047352f..000000000000 --- a/samples/server/petstore/rust-axum/output/rust-axum-test/src/tests.rs +++ /dev/null @@ -1,9 +0,0 @@ -#[test] -fn std_test() { - assert!(true); -} - -#[tokio::test] -async fn tokio_test() { - assert!(true); -} diff --git a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/.openapi-generator/FILES b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/.openapi-generator/FILES index 47de4e6caefd..683914c4c643 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/.openapi-generator/FILES +++ b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/.openapi-generator/FILES @@ -7,5 +7,4 @@ src/header.rs src/lib.rs src/models.rs src/server/mod.rs -src/tests.rs src/types.rs diff --git a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/lib.rs b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/lib.rs index 788f8dbd060b..bfdd7c899236 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/lib.rs +++ b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/lib.rs @@ -26,6 +26,3 @@ pub mod types; #[cfg(feature = "server")] pub(crate) mod header; - -#[cfg(test)] -mod tests; diff --git a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/tests.rs b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/tests.rs deleted file mode 100644 index 3a811047352f..000000000000 --- a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/tests.rs +++ /dev/null @@ -1,9 +0,0 @@ -#[test] -fn std_test() { - assert!(true); -} - -#[tokio::test] -async fn tokio_test() { - assert!(true); -}