forked from OpenAPITools/openapi-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ab259fa
commit 42b2b4a
Showing
38 changed files
with
264 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,6 @@ pub mod apis; | |
|
||
#[cfg(feature = "server")] | ||
pub(crate) mod header; | ||
|
||
#[cfg(test)] | ||
mod tests; |
9 changes: 9 additions & 0 deletions
9
modules/openapi-generator/src/main/resources/rust-axum/tests.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#[test] | ||
fn std_test() { | ||
assert!(true); | ||
} | ||
|
||
#[tokio::test] | ||
async fn tokio_test() { | ||
assert!(true); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ src/header.rs | |
src/lib.rs | ||
src/models.rs | ||
src/server/mod.rs | ||
src/tests.rs | ||
src/types.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,6 @@ pub mod types; | |
|
||
#[cfg(feature = "server")] | ||
pub(crate) mod header; | ||
|
||
#[cfg(test)] | ||
mod tests; |
9 changes: 9 additions & 0 deletions
9
samples/server/petstore/rust-axum/output/apikey-auths/src/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#[test] | ||
fn std_test() { | ||
assert!(true); | ||
} | ||
|
||
#[tokio::test] | ||
async fn tokio_test() { | ||
assert!(true); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ src/header.rs | |
src/lib.rs | ||
src/models.rs | ||
src/server/mod.rs | ||
src/tests.rs | ||
src/types.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,6 @@ pub mod types; | |
|
||
#[cfg(feature = "server")] | ||
pub(crate) mod header; | ||
|
||
#[cfg(test)] | ||
mod tests; |
9 changes: 9 additions & 0 deletions
9
samples/server/petstore/rust-axum/output/multipart-v3/src/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#[test] | ||
fn std_test() { | ||
assert!(true); | ||
} | ||
|
||
#[tokio::test] | ||
async fn tokio_test() { | ||
assert!(true); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,5 @@ src/header.rs | |
src/lib.rs | ||
src/models.rs | ||
src/server/mod.rs | ||
src/tests.rs | ||
src/types.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,6 @@ pub mod types; | |
|
||
#[cfg(feature = "server")] | ||
pub(crate) mod header; | ||
|
||
#[cfg(test)] | ||
mod tests; |
9 changes: 9 additions & 0 deletions
9
samples/server/petstore/rust-axum/output/openapi-v3/src/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#[test] | ||
fn std_test() { | ||
assert!(true); | ||
} | ||
|
||
#[tokio::test] | ||
async fn tokio_test() { | ||
assert!(true); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ src/header.rs | |
src/lib.rs | ||
src/models.rs | ||
src/server/mod.rs | ||
src/tests.rs | ||
src/types.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,6 @@ pub mod types; | |
|
||
#[cfg(feature = "server")] | ||
pub(crate) mod header; | ||
|
||
#[cfg(test)] | ||
mod tests; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#[test] | ||
fn std_test() { | ||
assert!(true); | ||
} | ||
|
||
#[tokio::test] | ||
async fn tokio_test() { | ||
assert!(true); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,5 @@ src/header.rs | |
src/lib.rs | ||
src/models.rs | ||
src/server/mod.rs | ||
src/tests.rs | ||
src/types.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,6 @@ pub mod types; | |
|
||
#[cfg(feature = "server")] | ||
pub(crate) mod header; | ||
|
||
#[cfg(test)] | ||
mod tests; |
9 changes: 9 additions & 0 deletions
9
...er/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#[test] | ||
fn std_test() { | ||
assert!(true); | ||
} | ||
|
||
#[tokio::test] | ||
async fn tokio_test() { | ||
assert!(true); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,5 @@ src/header.rs | |
src/lib.rs | ||
src/models.rs | ||
src/server/mod.rs | ||
src/tests.rs | ||
src/types.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,6 @@ pub mod types; | |
|
||
#[cfg(feature = "server")] | ||
pub(crate) mod header; | ||
|
||
#[cfg(test)] | ||
mod tests; |
9 changes: 9 additions & 0 deletions
9
samples/server/petstore/rust-axum/output/petstore/src/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#[test] | ||
fn std_test() { | ||
assert!(true); | ||
} | ||
|
||
#[tokio::test] | ||
async fn tokio_test() { | ||
assert!(true); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ src/header.rs | |
src/lib.rs | ||
src/models.rs | ||
src/server/mod.rs | ||
src/tests.rs | ||
src/types.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,6 @@ pub mod types; | |
|
||
#[cfg(feature = "server")] | ||
pub(crate) mod header; | ||
|
||
#[cfg(test)] | ||
mod tests; |
9 changes: 9 additions & 0 deletions
9
samples/server/petstore/rust-axum/output/ping-bearer-auth/src/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#[test] | ||
fn std_test() { | ||
assert!(true); | ||
} | ||
|
||
#[tokio::test] | ||
async fn tokio_test() { | ||
assert!(true); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ src/header.rs | |
src/lib.rs | ||
src/models.rs | ||
src/server/mod.rs | ||
src/tests.rs | ||
src/types.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,6 @@ pub mod types; | |
|
||
#[cfg(feature = "server")] | ||
pub(crate) mod header; | ||
|
||
#[cfg(test)] | ||
mod tests; |
9 changes: 9 additions & 0 deletions
9
samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#[test] | ||
fn std_test() { | ||
assert!(true); | ||
} | ||
|
||
#[tokio::test] | ||
async fn tokio_test() { | ||
assert!(true); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,6 @@ pub mod types; | |
|
||
#[cfg(feature = "server")] | ||
pub(crate) mod header; | ||
|
||
#[cfg(test)] | ||
mod tests; |
101 changes: 101 additions & 0 deletions
101
samples/server/petstore/rust-axum/output/rust-axum-oneof/src/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
#[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"}}"#; | ||
let test2 = r#"{"op": "Greeting", "d": {"greet_message": "test2"}}"#; | ||
let test3 = r#"{"op": "Goodbye", "d": {"goodbye_message": "test3"}}"#; | ||
|
||
let test4 = Hello { | ||
op: "ignored".to_string(), | ||
d: HelloD { | ||
welcome_message: "test4".to_string(), | ||
}, | ||
}; | ||
|
||
let test5 = Greeting { | ||
op: "ignored".to_string(), | ||
d: GreetingD { | ||
greet_message: "test5".to_string(), | ||
}, | ||
}; | ||
|
||
let test6 = Goodbye { | ||
op: "ignored".to_string(), | ||
d: GoodbyeD { | ||
goodbye_message: "test6".to_string(), | ||
}, | ||
}; | ||
|
||
let test7 = Message::Hello(test4.clone().into()); | ||
let test8 = Message::Greeting(test5.clone().into()); | ||
let test9 = Message::Goodbye(test6.clone().into()); | ||
|
||
let test10: Message = test4.clone().into(); | ||
let test11: Message = test5.clone().into(); | ||
let test12: Message = test6.clone().into(); | ||
|
||
let test13 = r#"{"op":"Hello","d":{"welcome_message":"test4"}}"#; | ||
let test14 = r#"{"d":{"greet_message":"test5"},"op":"Greeting"}"#; | ||
let test15 = r#"{"op":"Goodbye","d":{"goodbye_message":"test6"}}"#; | ||
|
||
assert!(serde_json::from_str::<Message>(test0).is_err()); | ||
|
||
assert!(serde_json::from_str::<Hello>(test0).is_ok()); | ||
assert!(serde_json::from_str::<Greeting>(test0).is_err()); | ||
assert!(serde_json::from_str::<Goodbye>(test0).is_err()); | ||
|
||
assert!(serde_json::from_str::<Message>(test1).is_ok()); | ||
assert!(serde_json::from_str::<Message>(test2).is_ok()); | ||
assert!(serde_json::from_str::<Message>(test3).is_ok()); | ||
|
||
assert!(serde_json::from_str::<Hello>(test1).is_ok()); | ||
assert!(serde_json::from_str::<Greeting>(test2).is_ok()); | ||
assert!(serde_json::from_str::<Message>(test3).is_ok()); | ||
|
||
assert_eq!( | ||
serde_json::to_string(&test4).expect("Serialization error"), | ||
test13 | ||
); | ||
assert_eq!( | ||
serde_json::to_string(&test5).expect("Serialization error"), | ||
test14 | ||
); | ||
assert_eq!( | ||
serde_json::to_string(&test6).expect("Serialization error"), | ||
test15 | ||
); | ||
|
||
assert_eq!( | ||
serde_json::to_string(&test7).expect("Serialization error"), | ||
test13 | ||
); | ||
assert_eq!( | ||
serde_json::to_string(&test8).expect("Serialization error"), | ||
test14 | ||
); | ||
assert_eq!( | ||
serde_json::to_string(&test9).expect("Serialization error"), | ||
test15 | ||
); | ||
|
||
assert_eq!( | ||
serde_json::to_string(&test10).expect("Serialization error"), | ||
test13 | ||
); | ||
assert_eq!( | ||
serde_json::to_string(&test11).expect("Serialization error"), | ||
test14 | ||
); | ||
assert_eq!( | ||
serde_json::to_string(&test12).expect("Serialization error"), | ||
test15 | ||
); | ||
} | ||
|
||
#[tokio::test] | ||
async fn tokio_test() { | ||
assert!(true); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ src/header.rs | |
src/lib.rs | ||
src/models.rs | ||
src/server/mod.rs | ||
src/tests.rs | ||
src/types.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,6 @@ pub mod types; | |
|
||
#[cfg(feature = "server")] | ||
pub(crate) mod header; | ||
|
||
#[cfg(test)] | ||
mod tests; |
9 changes: 9 additions & 0 deletions
9
samples/server/petstore/rust-axum/output/rust-axum-test/src/tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#[test] | ||
fn std_test() { | ||
assert!(true); | ||
} | ||
|
||
#[tokio::test] | ||
async fn tokio_test() { | ||
assert!(true); | ||
} |
Oops, something went wrong.