From e388ef080f2d99ba3d1dd7136fba40a937454978 Mon Sep 17 00:00:00 2001 From: Artem Medvedev Date: Tue, 20 Feb 2024 01:47:47 +0100 Subject: [PATCH 01/13] fix(rust): discriminator mapping to serde rename Discriminator mapping has been ignored in some cases. Even existing samples had wrong definition in some cases This PR addresses this --- .../src/main/resources/rust/model.mustache | 10 +++++++++- .../composed-oneof/src/models/create_state_request.rs | 2 ++ .../src/models/custom_one_of_array_schema_inner.rs | 3 +++ .../composed-oneof/src/models/custom_one_of_schema.rs | 2 ++ .../src/models/get_state_200_response.rs | 3 +++ .../client/others/rust/hyper/oneOf/src/models/fruit.rs | 2 ++ .../composed-oneof/src/models/create_state_request.rs | 2 ++ .../src/models/custom_one_of_array_schema_inner.rs | 3 +++ .../composed-oneof/src/models/custom_one_of_schema.rs | 2 ++ .../src/models/get_state_200_response.rs | 3 +++ .../others/rust/reqwest/oneOf/src/models/fruit.rs | 2 ++ 11 files changed, 33 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/rust/model.mustache b/modules/openapi-generator/src/main/resources/rust/model.mustache index a3eccd350131..73637837fb0a 100644 --- a/modules/openapi-generator/src/main/resources/rust/model.mustache +++ b/modules/openapi-generator/src/main/resources/rust/model.mustache @@ -60,12 +60,20 @@ pub enum {{{classname}}} { }, {{/mappedModels}} {{/oneOf}} - {{#oneOf}} + {{^oneOf.isEmpty}} {{#description}} /// {{{.}}} {{/description}} + {{#mappedModels}} + #[serde(rename="{{mappingName}}")] + {{{modelName}}}(Box<{{{modelName}}}>), + {{/mappedModels}} + {{^mappedModels}} + {{#oneOf}} {{{.}}}(Box<{{{.}}}>), {{/oneOf}} + {{/mappedModels}} + {{/oneOf.isEmpty}} } impl Default for {{classname}} { diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs index 5bd7a69cd8a9..2fd5717a7f04 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs @@ -15,7 +15,9 @@ use super::ObjB; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "realtype")] pub enum CreateStateRequest { + #[serde(rename="a-type")] ObjA(Box), + #[serde(rename="b-type")] ObjB(Box), } diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs index 043f0b615acf..c839b464e744 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs @@ -16,8 +16,11 @@ use super::ObjC; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "realtype")] pub enum CustomOneOfArraySchemaInner { + #[serde(rename="a-type")] ObjA(Box), + #[serde(rename="b-type")] ObjB(Box), + #[serde(rename="c-type")] ObjC(Box), } diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs index 535f119b7151..5ae9423ba88c 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs @@ -15,7 +15,9 @@ use super::ObjB; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "realtype")] pub enum CustomOneOfSchema { + #[serde(rename="a-type")] ObjA(Box), + #[serde(rename="b-type")] ObjB(Box), } diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs index d86f8d6ab65d..8ae1d14d41dc 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs @@ -16,8 +16,11 @@ use super::ObjD; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "realtype")] pub enum GetState200Response { + #[serde(rename="a-type")] ObjA(Box), + #[serde(rename="b-type")] ObjB(Box), + #[serde(rename="d-type")] ObjD(Box), } diff --git a/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs b/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs index 4c01c95a8d7e..d9bc5e23d479 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs @@ -15,7 +15,9 @@ use super::Banana; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "fruitType")] pub enum Fruit { + #[serde(rename="APPLE")] Apple(Box), + #[serde(rename="BANANA")] Banana(Box), } diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs index 5bd7a69cd8a9..2fd5717a7f04 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs @@ -15,7 +15,9 @@ use super::ObjB; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "realtype")] pub enum CreateStateRequest { + #[serde(rename="a-type")] ObjA(Box), + #[serde(rename="b-type")] ObjB(Box), } diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs index 043f0b615acf..c839b464e744 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs @@ -16,8 +16,11 @@ use super::ObjC; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "realtype")] pub enum CustomOneOfArraySchemaInner { + #[serde(rename="a-type")] ObjA(Box), + #[serde(rename="b-type")] ObjB(Box), + #[serde(rename="c-type")] ObjC(Box), } diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs index 535f119b7151..5ae9423ba88c 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs @@ -15,7 +15,9 @@ use super::ObjB; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "realtype")] pub enum CustomOneOfSchema { + #[serde(rename="a-type")] ObjA(Box), + #[serde(rename="b-type")] ObjB(Box), } diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs index d86f8d6ab65d..8ae1d14d41dc 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs @@ -16,8 +16,11 @@ use super::ObjD; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "realtype")] pub enum GetState200Response { + #[serde(rename="a-type")] ObjA(Box), + #[serde(rename="b-type")] ObjB(Box), + #[serde(rename="d-type")] ObjD(Box), } diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs b/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs index 4c01c95a8d7e..d9bc5e23d479 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs @@ -15,7 +15,9 @@ use super::Banana; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "fruitType")] pub enum Fruit { + #[serde(rename="APPLE")] Apple(Box), + #[serde(rename="BANANA")] Banana(Box), } From 6f8c00cf6e287a258513cf83f04dbe4cf46a4180 Mon Sep 17 00:00:00 2001 From: Artem Medvedev Date: Wed, 21 Feb 2024 02:14:35 +0100 Subject: [PATCH 02/13] fix(rust): `oneOf` generation for client Solves #17869 and #17896 and also includes unmerged $17898 Unfortunately it affects quite a lot of code, but we can see that only client-side models were affected by re-generation. I tried to split this PR to several, but they're really coupled and hard to create a chain of PRs. --- .../rust-hyper-oneOf-array-map-import.yaml | 8 + .../rust-reqwest-oneOf-array-map-import.yaml | 8 + .../languages/AbstractRustCodegen.java | 77 +++++- .../languages/RustAxumServerCodegen.java | 69 ----- .../codegen/languages/RustClientCodegen.java | 82 +++--- .../codegen/languages/RustServerCodegen.java | 54 ---- .../src/main/resources/rust/lib.mustache | 2 + .../src/main/resources/rust/model.mustache | 34 ++- .../hyper/composed-oneof/docs/DefaultApi.md | 4 +- .../composed-oneof/src/apis/default_api.rs | 4 +- .../rust/hyper/composed-oneof/src/lib.rs | 2 + .../src/models/create_state_request.rs | 7 +- .../custom_one_of_array_schema_inner.rs | 8 +- .../src/models/custom_one_of_schema.rs | 7 +- .../src/models/get_state_200_response.rs | 8 +- .../hyper/composed-oneof/src/models/obj_a.rs | 2 + .../hyper/composed-oneof/src/models/obj_b.rs | 2 + .../hyper/composed-oneof/src/models/obj_c.rs | 2 + .../hyper/composed-oneof/src/models/obj_d.rs | 2 + .../rust/hyper/emptyObject/docs/DefaultApi.md | 4 +- .../hyper/emptyObject/src/apis/default_api.rs | 4 +- .../others/rust/hyper/emptyObject/src/lib.rs | 2 + .../emptyObject/src/models/empty_object.rs | 2 + .../rust/hyper/oneOf-array-map/.gitignore | 3 + .../oneOf-array-map/.openapi-generator-ignore | 23 ++ .../oneOf-array-map/.openapi-generator/FILES | 19 ++ .../.openapi-generator/VERSION | 1 + .../rust/hyper/oneOf-array-map/.travis.yml | 1 + .../rust/hyper/oneOf-array-map/Cargo.toml | 20 ++ .../rust/hyper/oneOf-array-map/README.md | 48 ++++ .../rust/hyper/oneOf-array-map/docs/Apple.md | 11 + .../hyper/oneOf-array-map/docs/DefaultApi.md | 63 +++++ .../rust/hyper/oneOf-array-map/docs/Fruit.md | 12 + .../rust/hyper/oneOf-array-map/docs/Grape.md | 11 + .../rust/hyper/oneOf-array-map/git_push.sh | 57 +++++ .../hyper/oneOf-array-map/src/apis/client.rs | 24 ++ .../oneOf-array-map/src/apis/configuration.rs | 43 ++++ .../oneOf-array-map/src/apis/default_api.rs | 62 +++++ .../hyper/oneOf-array-map/src/apis/mod.rs | 54 ++++ .../hyper/oneOf-array-map/src/apis/request.rs | 242 ++++++++++++++++++ .../rust/hyper/oneOf-array-map/src/lib.rs | 13 + .../hyper/oneOf-array-map/src/models/apple.rs | 30 +++ .../hyper/oneOf-array-map/src/models/fruit.rs | 29 +++ .../hyper/oneOf-array-map/src/models/grape.rs | 30 +++ .../hyper/oneOf-array-map/src/models/mod.rs | 6 + .../others/rust/hyper/oneOf/docs/Bar.md | 2 +- .../others/rust/hyper/oneOf/docs/BarApi.md | 4 +- .../others/rust/hyper/oneOf/docs/BarCreate.md | 2 +- .../others/rust/hyper/oneOf/docs/FooApi.md | 8 +- .../others/rust/hyper/oneOf/docs/Pizza.md | 2 +- .../rust/hyper/oneOf/docs/PizzaSpeziale.md | 2 +- .../rust/hyper/oneOf/src/apis/bar_api.rs | 4 +- .../rust/hyper/oneOf/src/apis/foo_api.rs | 8 +- .../client/others/rust/hyper/oneOf/src/lib.rs | 2 + .../hyper/oneOf/src/models/addressable.rs | 2 + .../rust/hyper/oneOf/src/models/apple.rs | 2 + .../rust/hyper/oneOf/src/models/banana.rs | 2 + .../others/rust/hyper/oneOf/src/models/bar.rs | 4 +- .../rust/hyper/oneOf/src/models/bar_create.rs | 4 +- .../rust/hyper/oneOf/src/models/bar_ref.rs | 2 + .../oneOf/src/models/bar_ref_or_value.rs | 8 +- .../rust/hyper/oneOf/src/models/entity.rs | 2 + .../rust/hyper/oneOf/src/models/entity_ref.rs | 2 + .../rust/hyper/oneOf/src/models/extensible.rs | 2 + .../others/rust/hyper/oneOf/src/models/foo.rs | 2 + .../rust/hyper/oneOf/src/models/foo_ref.rs | 2 + .../oneOf/src/models/foo_ref_or_value.rs | 9 +- .../rust/hyper/oneOf/src/models/fruit.rs | 7 +- .../rust/hyper/oneOf/src/models/fruit_type.rs | 2 + .../rust/hyper/oneOf/src/models/pasta.rs | 2 + .../rust/hyper/oneOf/src/models/pizza.rs | 4 +- .../hyper/oneOf/src/models/pizza_speziale.rs | 4 +- .../docs/DefaultApi.md | 4 +- .../reqwest-regression-16119/docs/Parent.md | 2 +- .../src/apis/default_api.rs | 2 +- .../rust/reqwest-regression-16119/src/lib.rs | 2 + .../src/models/parent.rs | 4 +- .../reqwest/composed-oneof/docs/DefaultApi.md | 4 +- .../composed-oneof/src/apis/default_api.rs | 2 +- .../rust/reqwest/composed-oneof/src/lib.rs | 2 + .../src/models/create_state_request.rs | 7 +- .../custom_one_of_array_schema_inner.rs | 8 +- .../src/models/custom_one_of_schema.rs | 7 +- .../src/models/get_state_200_response.rs | 8 +- .../composed-oneof/src/models/obj_a.rs | 2 + .../composed-oneof/src/models/obj_b.rs | 2 + .../composed-oneof/src/models/obj_c.rs | 2 + .../composed-oneof/src/models/obj_d.rs | 2 + .../reqwest/emptyObject/docs/DefaultApi.md | 4 +- .../emptyObject/src/apis/default_api.rs | 2 +- .../rust/reqwest/emptyObject/src/lib.rs | 2 + .../emptyObject/src/models/empty_object.rs | 2 + .../rust/reqwest/oneOf-array-map/.gitignore | 3 + .../oneOf-array-map/.openapi-generator-ignore | 23 ++ .../oneOf-array-map/.openapi-generator/FILES | 17 ++ .../.openapi-generator/VERSION | 1 + .../rust/reqwest/oneOf-array-map/.travis.yml | 1 + .../rust/reqwest/oneOf-array-map/Cargo.toml | 18 ++ .../rust/reqwest/oneOf-array-map/README.md | 48 ++++ .../reqwest/oneOf-array-map/docs/Apple.md | 11 + .../oneOf-array-map/docs/DefaultApi.md | 63 +++++ .../reqwest/oneOf-array-map/docs/Fruit.md | 12 + .../reqwest/oneOf-array-map/docs/Grape.md | 11 + .../rust/reqwest/oneOf-array-map/git_push.sh | 57 +++++ .../oneOf-array-map/src/apis/configuration.rs | 53 ++++ .../oneOf-array-map/src/apis/default_api.rs | 87 +++++++ .../reqwest/oneOf-array-map/src/apis/mod.rs | 95 +++++++ .../rust/reqwest/oneOf-array-map/src/lib.rs | 12 + .../oneOf-array-map/src/models/apple.rs | 30 +++ .../oneOf-array-map/src/models/fruit.rs | 29 +++ .../oneOf-array-map/src/models/grape.rs | 30 +++ .../reqwest/oneOf-array-map/src/models/mod.rs | 6 + .../others/rust/reqwest/oneOf/docs/Bar.md | 2 +- .../others/rust/reqwest/oneOf/docs/BarApi.md | 4 +- .../rust/reqwest/oneOf/docs/BarCreate.md | 2 +- .../others/rust/reqwest/oneOf/docs/FooApi.md | 8 +- .../others/rust/reqwest/oneOf/docs/Pizza.md | 2 +- .../rust/reqwest/oneOf/docs/PizzaSpeziale.md | 2 +- .../rust/reqwest/oneOf/src/apis/bar_api.rs | 2 +- .../rust/reqwest/oneOf/src/apis/foo_api.rs | 4 +- .../others/rust/reqwest/oneOf/src/lib.rs | 2 + .../reqwest/oneOf/src/models/addressable.rs | 2 + .../rust/reqwest/oneOf/src/models/apple.rs | 2 + .../rust/reqwest/oneOf/src/models/banana.rs | 2 + .../rust/reqwest/oneOf/src/models/bar.rs | 4 +- .../reqwest/oneOf/src/models/bar_create.rs | 4 +- .../rust/reqwest/oneOf/src/models/bar_ref.rs | 2 + .../oneOf/src/models/bar_ref_or_value.rs | 8 +- .../rust/reqwest/oneOf/src/models/entity.rs | 2 + .../reqwest/oneOf/src/models/entity_ref.rs | 2 + .../reqwest/oneOf/src/models/extensible.rs | 2 + .../rust/reqwest/oneOf/src/models/foo.rs | 2 + .../rust/reqwest/oneOf/src/models/foo_ref.rs | 2 + .../oneOf/src/models/foo_ref_or_value.rs | 9 +- .../rust/reqwest/oneOf/src/models/fruit.rs | 7 +- .../reqwest/oneOf/src/models/fruit_type.rs | 2 + .../rust/reqwest/oneOf/src/models/pasta.rs | 2 + .../rust/reqwest/oneOf/src/models/pizza.rs | 4 +- .../oneOf/src/models/pizza_speziale.rs | 4 +- .../hyper/petstore/docs/ActionContainer.md | 2 +- .../hyper/petstore/docs/ArrayItemRefTest.md | 4 +- .../petstore/rust/hyper/petstore/docs/Pet.md | 4 +- .../rust/hyper/petstore/docs/PetApi.md | 24 +- .../rust/hyper/petstore/docs/StoreApi.md | 12 +- .../rust/hyper/petstore/docs/TestingApi.md | 4 +- .../rust/hyper/petstore/docs/UserApi.md | 8 +- .../rust/hyper/petstore/src/apis/pet_api.rs | 24 +- .../rust/hyper/petstore/src/apis/store_api.rs | 12 +- .../hyper/petstore/src/apis/testing_api.rs | 4 +- .../rust/hyper/petstore/src/apis/user_api.rs | 12 +- .../petstore/rust/hyper/petstore/src/lib.rs | 2 + .../petstore/src/models/action_container.rs | 6 +- .../hyper/petstore/src/models/api_response.rs | 2 + .../src/models/array_item_ref_test.rs | 8 +- .../rust/hyper/petstore/src/models/baz.rs | 2 + .../hyper/petstore/src/models/category.rs | 2 + .../petstore/src/models/enum_array_testing.rs | 2 + .../hyper/petstore/src/models/model_return.rs | 2 + .../petstore/src/models/nullable_array.rs | 2 + .../petstore/src/models/optional_testing.rs | 2 + .../rust/hyper/petstore/src/models/order.rs | 2 + .../rust/hyper/petstore/src/models/pet.rs | 6 +- .../petstore/src/models/property_test.rs | 2 + .../rust/hyper/petstore/src/models/tag.rs | 2 + .../hyper/petstore/src/models/type_testing.rs | 2 + .../src/models/unique_item_array_testing.rs | 2 + .../rust/hyper/petstore/src/models/user.rs | 2 + .../rust/reqwest/name-mapping/src/lib.rs | 2 + .../src/models/property_name_mapping.rs | 2 + .../docs/ActionContainer.md | 2 +- .../docs/ArrayItemRefTest.md | 4 +- .../petstore-async-middleware/docs/Pet.md | 4 +- .../petstore-async-middleware/docs/PetApi.md | 24 +- .../docs/StoreApi.md | 12 +- .../docs/TestingApi.md | 4 +- .../petstore-async-middleware/docs/UserApi.md | 8 +- .../src/apis/pet_api.rs | 12 +- .../src/apis/store_api.rs | 6 +- .../src/apis/testing_api.rs | 2 +- .../src/apis/user_api.rs | 6 +- .../petstore-async-middleware/src/lib.rs | 2 + .../src/models/action_container.rs | 6 +- .../src/models/api_response.rs | 2 + .../src/models/array_item_ref_test.rs | 8 +- .../src/models/baz.rs | 2 + .../src/models/category.rs | 2 + .../src/models/enum_array_testing.rs | 2 + .../src/models/model_return.rs | 2 + .../src/models/nullable_array.rs | 2 + .../src/models/optional_testing.rs | 2 + .../src/models/order.rs | 2 + .../src/models/pet.rs | 6 +- .../src/models/property_test.rs | 2 + .../src/models/tag.rs | 2 + .../src/models/type_testing.rs | 2 + .../src/models/unique_item_array_testing.rs | 2 + .../src/models/user.rs | 2 + .../petstore-async/docs/ActionContainer.md | 2 +- .../petstore-async/docs/ArrayItemRefTest.md | 4 +- .../rust/reqwest/petstore-async/docs/Pet.md | 4 +- .../reqwest/petstore-async/docs/PetApi.md | 24 +- .../reqwest/petstore-async/docs/StoreApi.md | 12 +- .../reqwest/petstore-async/docs/TestingApi.md | 4 +- .../reqwest/petstore-async/docs/UserApi.md | 8 +- .../petstore-async/src/apis/pet_api.rs | 12 +- .../petstore-async/src/apis/store_api.rs | 6 +- .../petstore-async/src/apis/testing_api.rs | 2 +- .../petstore-async/src/apis/user_api.rs | 6 +- .../rust/reqwest/petstore-async/src/lib.rs | 2 + .../src/models/action_container.rs | 6 +- .../petstore-async/src/models/api_response.rs | 2 + .../src/models/array_item_ref_test.rs | 8 +- .../reqwest/petstore-async/src/models/baz.rs | 2 + .../petstore-async/src/models/category.rs | 2 + .../src/models/enum_array_testing.rs | 2 + .../petstore-async/src/models/model_return.rs | 2 + .../src/models/nullable_array.rs | 2 + .../src/models/optional_testing.rs | 2 + .../petstore-async/src/models/order.rs | 2 + .../reqwest/petstore-async/src/models/pet.rs | 6 +- .../src/models/property_test.rs | 2 + .../reqwest/petstore-async/src/models/tag.rs | 2 + .../petstore-async/src/models/type_testing.rs | 2 + .../src/models/unique_item_array_testing.rs | 2 + .../reqwest/petstore-async/src/models/user.rs | 2 + .../docs/ActionContainer.md | 2 +- .../docs/ArrayItemRefTest.md | 4 +- .../petstore-awsv4signature/docs/Pet.md | 4 +- .../petstore-awsv4signature/docs/PetApi.md | 24 +- .../petstore-awsv4signature/docs/StoreApi.md | 12 +- .../docs/TestingApi.md | 4 +- .../petstore-awsv4signature/docs/UserApi.md | 8 +- .../src/apis/pet_api.rs | 12 +- .../src/apis/store_api.rs | 6 +- .../src/apis/testing_api.rs | 2 +- .../src/apis/user_api.rs | 6 +- .../petstore-awsv4signature/src/lib.rs | 2 + .../src/models/action_container.rs | 6 +- .../src/models/api_response.rs | 2 + .../src/models/array_item_ref_test.rs | 8 +- .../petstore-awsv4signature/src/models/baz.rs | 2 + .../src/models/category.rs | 2 + .../src/models/enum_array_testing.rs | 2 + .../src/models/model_return.rs | 2 + .../src/models/nullable_array.rs | 2 + .../src/models/optional_testing.rs | 2 + .../src/models/order.rs | 2 + .../petstore-awsv4signature/src/models/pet.rs | 6 +- .../src/models/property_test.rs | 2 + .../petstore-awsv4signature/src/models/tag.rs | 2 + .../src/models/type_testing.rs | 2 + .../src/models/unique_item_array_testing.rs | 2 + .../src/models/user.rs | 2 + .../reqwest/petstore/docs/ActionContainer.md | 2 +- .../reqwest/petstore/docs/ArrayItemRefTest.md | 4 +- .../rust/reqwest/petstore/docs/Pet.md | 4 +- .../rust/reqwest/petstore/docs/PetApi.md | 24 +- .../rust/reqwest/petstore/docs/StoreApi.md | 12 +- .../rust/reqwest/petstore/docs/TestingApi.md | 4 +- .../rust/reqwest/petstore/docs/UserApi.md | 8 +- .../rust/reqwest/petstore/src/apis/pet_api.rs | 12 +- .../reqwest/petstore/src/apis/store_api.rs | 6 +- .../reqwest/petstore/src/apis/testing_api.rs | 2 +- .../reqwest/petstore/src/apis/user_api.rs | 6 +- .../petstore/rust/reqwest/petstore/src/lib.rs | 2 + .../petstore/src/models/action_container.rs | 6 +- .../petstore/src/models/api_response.rs | 2 + .../src/models/array_item_ref_test.rs | 8 +- .../rust/reqwest/petstore/src/models/baz.rs | 2 + .../reqwest/petstore/src/models/category.rs | 2 + .../petstore/src/models/enum_array_testing.rs | 2 + .../petstore/src/models/model_return.rs | 2 + .../petstore/src/models/nullable_array.rs | 2 + .../petstore/src/models/optional_testing.rs | 2 + .../rust/reqwest/petstore/src/models/order.rs | 2 + .../rust/reqwest/petstore/src/models/pet.rs | 6 +- .../petstore/src/models/property_test.rs | 2 + .../rust/reqwest/petstore/src/models/tag.rs | 2 + .../petstore/src/models/type_testing.rs | 2 + .../src/models/unique_item_array_testing.rs | 2 + .../rust/reqwest/petstore/src/models/user.rs | 2 + 281 files changed, 2202 insertions(+), 547 deletions(-) create mode 100644 bin/configs/rust-hyper-oneOf-array-map-import.yaml create mode 100644 bin/configs/rust-reqwest-oneOf-array-map-import.yaml create mode 100644 samples/client/others/rust/hyper/oneOf-array-map/.gitignore create mode 100644 samples/client/others/rust/hyper/oneOf-array-map/.openapi-generator-ignore create mode 100644 samples/client/others/rust/hyper/oneOf-array-map/.openapi-generator/FILES create mode 100644 samples/client/others/rust/hyper/oneOf-array-map/.openapi-generator/VERSION create mode 100644 samples/client/others/rust/hyper/oneOf-array-map/.travis.yml create mode 100644 samples/client/others/rust/hyper/oneOf-array-map/Cargo.toml create mode 100644 samples/client/others/rust/hyper/oneOf-array-map/README.md create mode 100644 samples/client/others/rust/hyper/oneOf-array-map/docs/Apple.md create mode 100644 samples/client/others/rust/hyper/oneOf-array-map/docs/DefaultApi.md create mode 100644 samples/client/others/rust/hyper/oneOf-array-map/docs/Fruit.md create mode 100644 samples/client/others/rust/hyper/oneOf-array-map/docs/Grape.md create mode 100644 samples/client/others/rust/hyper/oneOf-array-map/git_push.sh create mode 100644 samples/client/others/rust/hyper/oneOf-array-map/src/apis/client.rs create mode 100644 samples/client/others/rust/hyper/oneOf-array-map/src/apis/configuration.rs create mode 100644 samples/client/others/rust/hyper/oneOf-array-map/src/apis/default_api.rs create mode 100644 samples/client/others/rust/hyper/oneOf-array-map/src/apis/mod.rs create mode 100644 samples/client/others/rust/hyper/oneOf-array-map/src/apis/request.rs create mode 100644 samples/client/others/rust/hyper/oneOf-array-map/src/lib.rs create mode 100644 samples/client/others/rust/hyper/oneOf-array-map/src/models/apple.rs create mode 100644 samples/client/others/rust/hyper/oneOf-array-map/src/models/fruit.rs create mode 100644 samples/client/others/rust/hyper/oneOf-array-map/src/models/grape.rs create mode 100644 samples/client/others/rust/hyper/oneOf-array-map/src/models/mod.rs create mode 100644 samples/client/others/rust/reqwest/oneOf-array-map/.gitignore create mode 100644 samples/client/others/rust/reqwest/oneOf-array-map/.openapi-generator-ignore create mode 100644 samples/client/others/rust/reqwest/oneOf-array-map/.openapi-generator/FILES create mode 100644 samples/client/others/rust/reqwest/oneOf-array-map/.openapi-generator/VERSION create mode 100644 samples/client/others/rust/reqwest/oneOf-array-map/.travis.yml create mode 100644 samples/client/others/rust/reqwest/oneOf-array-map/Cargo.toml create mode 100644 samples/client/others/rust/reqwest/oneOf-array-map/README.md create mode 100644 samples/client/others/rust/reqwest/oneOf-array-map/docs/Apple.md create mode 100644 samples/client/others/rust/reqwest/oneOf-array-map/docs/DefaultApi.md create mode 100644 samples/client/others/rust/reqwest/oneOf-array-map/docs/Fruit.md create mode 100644 samples/client/others/rust/reqwest/oneOf-array-map/docs/Grape.md create mode 100644 samples/client/others/rust/reqwest/oneOf-array-map/git_push.sh create mode 100644 samples/client/others/rust/reqwest/oneOf-array-map/src/apis/configuration.rs create mode 100644 samples/client/others/rust/reqwest/oneOf-array-map/src/apis/default_api.rs create mode 100644 samples/client/others/rust/reqwest/oneOf-array-map/src/apis/mod.rs create mode 100644 samples/client/others/rust/reqwest/oneOf-array-map/src/lib.rs create mode 100644 samples/client/others/rust/reqwest/oneOf-array-map/src/models/apple.rs create mode 100644 samples/client/others/rust/reqwest/oneOf-array-map/src/models/fruit.rs create mode 100644 samples/client/others/rust/reqwest/oneOf-array-map/src/models/grape.rs create mode 100644 samples/client/others/rust/reqwest/oneOf-array-map/src/models/mod.rs diff --git a/bin/configs/rust-hyper-oneOf-array-map-import.yaml b/bin/configs/rust-hyper-oneOf-array-map-import.yaml new file mode 100644 index 000000000000..525fc5108a74 --- /dev/null +++ b/bin/configs/rust-hyper-oneOf-array-map-import.yaml @@ -0,0 +1,8 @@ +generatorName: rust +outputDir: samples/client/others/rust/hyper/oneOf-array-map +library: hyper +inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOfArrayMapImport.yaml +templateDir: modules/openapi-generator/src/main/resources/rust +additionalProperties: + supportAsync: false + packageName: oneof-array-map-hyper diff --git a/bin/configs/rust-reqwest-oneOf-array-map-import.yaml b/bin/configs/rust-reqwest-oneOf-array-map-import.yaml new file mode 100644 index 000000000000..cb825552d0b9 --- /dev/null +++ b/bin/configs/rust-reqwest-oneOf-array-map-import.yaml @@ -0,0 +1,8 @@ +generatorName: rust +outputDir: samples/client/others/rust/reqwest/oneOf-array-map +library: reqwest +inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOfArrayMapImport.yaml +templateDir: modules/openapi-generator/src/main/resources/rust +additionalProperties: + supportAsync: false + packageName: oneof-array-map-reqwest diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRustCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRustCodegen.java index 107cf5dbdba4..59ccdcd1c94d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRustCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRustCodegen.java @@ -2,10 +2,11 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Strings; -import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.DefaultCodegen; -import org.openapitools.codegen.GeneratorLanguage; +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.FileSchema; +import io.swagger.v3.oas.models.media.Schema; +import org.openapitools.codegen.*; +import org.openapitools.codegen.utils.ModelUtils; import org.openapitools.codegen.utils.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -232,6 +233,74 @@ public String sanitizeIdentifier(String name, CasingType casingType, String esca return name; } + @Override + public String getTypeDeclaration(Schema p) { + if (ModelUtils.isArraySchema(p)) { + ArraySchema ap = (ArraySchema) p; + Schema inner = ap.getItems(); + String innerType = getTypeDeclaration(inner); + return typeMapping.get("array") + "<" + innerType + ">"; + } else if (ModelUtils.isMapSchema(p)) { + Schema inner = ModelUtils.getAdditionalProperties(p); + String innerType = getTypeDeclaration(inner); + StringBuilder typeDeclaration = new StringBuilder(typeMapping.get("map")).append("<").append(typeMapping.get("string")).append(", "); + typeDeclaration.append(innerType).append(">"); + return typeDeclaration.toString(); + } else if (!org.apache.commons.lang3.StringUtils.isEmpty(p.get$ref())) { + String datatype; + try { + datatype = p.get$ref(); + + if (datatype.indexOf("#/components/schemas/") == 0) { + datatype = toModelName(datatype.substring("#/components/schemas/".length())); + datatype = "models::" + datatype; + } + } catch (Exception e) { + LOGGER.warn("Error obtaining the datatype from schema (model):{}. Datatype default to Object", p); + datatype = "Object"; + LOGGER.error(e.getMessage(), e); + } + return datatype; + } else if (p instanceof FileSchema) { + return typeMapping.get("file"); + } + + return super.getTypeDeclaration(p); + } + + @Override + public CodegenModel fromModel(String name, Schema model) { + LOGGER.trace("Creating model from schema: {}", model); + + Map allDefinitions = ModelUtils.getSchemas(this.openAPI); + CodegenModel mdl = super.fromModel(name, model); + + mdl.vendorExtensions.put("x-upper-case-name", name.toUpperCase(Locale.ROOT)); + if (!org.apache.commons.lang3.StringUtils.isEmpty(model.get$ref())) { + Schema schema = allDefinitions.get(ModelUtils.getSimpleRef(model.get$ref())); + mdl.dataType = typeMapping.get(schema.getType()); + } + if (ModelUtils.isArraySchema(model)) { + if (typeMapping.containsKey(mdl.arrayModelType)) { + mdl.arrayModelType = typeMapping.get(mdl.arrayModelType); + } else { + mdl.arrayModelType = toModelName(mdl.arrayModelType); + } + } else if ((!mdl.anyOf.isEmpty()) || (!mdl.oneOf.isEmpty())) { + mdl.dataType = getSchemaType(model); + } + + Schema additionalProperties = ModelUtils.getAdditionalProperties(model); + + if (additionalProperties != null) { + mdl.additionalPropertiesType = getTypeDeclaration(additionalProperties); + } + + LOGGER.trace("Created model: {}", mdl); + + return mdl; + } + @Override public String toVarName(String name) { // obtain the name from nameMapping directly if provided 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 74de3a6b530d..ecbc29c5c32c 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 @@ -21,7 +21,6 @@ import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.FileSchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.parameters.RequestBody; @@ -703,41 +702,6 @@ public CodegenParameter fromRequestBody(RequestBody body, Set imports, S return codegenParameter; } - @Override - public String getTypeDeclaration(Schema p) { - if (ModelUtils.isArraySchema(p)) { - ArraySchema ap = (ArraySchema) p; - Schema inner = ap.getItems(); - String innerType = getTypeDeclaration(inner); - return typeMapping.get("array") + "<" + innerType + ">"; - } else if (ModelUtils.isMapSchema(p)) { - Schema inner = ModelUtils.getAdditionalProperties(p); - String innerType = getTypeDeclaration(inner); - StringBuilder typeDeclaration = new StringBuilder(typeMapping.get("map")).append("<").append(typeMapping.get("string")).append(", "); - typeDeclaration.append(innerType).append(">"); - return typeDeclaration.toString(); - } else if (!StringUtils.isEmpty(p.get$ref())) { - String datatype; - try { - datatype = p.get$ref(); - - if (datatype.indexOf("#/components/schemas/") == 0) { - datatype = toModelName(datatype.substring("#/components/schemas/".length())); - datatype = "models::" + datatype; - } - } catch (Exception e) { - LOGGER.warn("Error obtaining the datatype from schema (model):{}. Datatype default to Object", p); - datatype = "Object"; - LOGGER.error(e.getMessage(), e); - } - return datatype; - } else if (p instanceof FileSchema) { - return typeMapping.get("File"); - } - - return super.getTypeDeclaration(p); - } - @Override public String toInstantiationType(Schema p) { if (ModelUtils.isArraySchema(p)) { @@ -752,39 +716,6 @@ public String toInstantiationType(Schema p) { } } - @Override - public CodegenModel fromModel(String name, Schema model) { - LOGGER.trace("Creating model from schema: {}", model); - - Map allDefinitions = ModelUtils.getSchemas(this.openAPI); - CodegenModel mdl = super.fromModel(name, model); - - mdl.vendorExtensions.put("x-upper-case-name", name.toUpperCase(Locale.ROOT)); - if (!StringUtils.isEmpty(model.get$ref())) { - Schema schema = allDefinitions.get(ModelUtils.getSimpleRef(model.get$ref())); - mdl.dataType = typeMapping.get(schema.getType()); - } - if (ModelUtils.isArraySchema(model)) { - if (typeMapping.containsKey(mdl.arrayModelType)) { - mdl.arrayModelType = typeMapping.get(mdl.arrayModelType); - } else { - mdl.arrayModelType = toModelName(mdl.arrayModelType); - } - } else if ((!mdl.anyOf.isEmpty()) || (!mdl.oneOf.isEmpty())) { - mdl.dataType = getSchemaType(model); - } - - Schema additionalProperties = ModelUtils.getAdditionalProperties(model); - - if (additionalProperties != null) { - mdl.additionalPropertiesType = getTypeDeclaration(additionalProperties); - } - - LOGGER.trace("Created model: {}", mdl); - - return mdl; - } - @Override public Map postProcessSupportingFileData(Map bundle) { generateYAMLSpecFile(bundle); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java index c9ad555e6056..841ad961a290 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java @@ -20,6 +20,7 @@ import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.FileSchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.StringSchema; import io.swagger.v3.parser.util.SchemaTypeUtil; @@ -42,8 +43,6 @@ import java.math.BigInteger; import java.util.*; -import static org.openapitools.codegen.utils.StringUtils.camelize; - public class RustClientCodegen extends AbstractRustCodegen implements CodegenConfig { private final Logger LOGGER = LoggerFactory.getLogger(RustClientCodegen.class); private boolean useSingleRequestParameter = false; @@ -149,11 +148,13 @@ public RustClientCodegen() { typeMapping.clear(); typeMapping.put("integer", "i32"); typeMapping.put("long", "i64"); - typeMapping.put("number", "f32"); + typeMapping.put("number", "f64"); typeMapping.put("float", "f32"); typeMapping.put("double", "f64"); typeMapping.put("boolean", "bool"); typeMapping.put("string", "String"); + typeMapping.put("array", "Vec"); + typeMapping.put("map", "std::collections::HashMap"); typeMapping.put("UUID", "uuid::Uuid"); typeMapping.put("URI", "String"); typeMapping.put("date", "string"); @@ -205,11 +206,45 @@ public RustClientCodegen() { setLibrary(REQWEST_LIBRARY); } + @Override + public CodegenModel fromModel(String name, Schema model) { + CodegenModel mdl = super.fromModel(name, model); + + // set alias names to oneOf in composed-schema to use as enum variant names + if (mdl.getComposedSchemas() != null && mdl.getComposedSchemas().getOneOf() != null + && !mdl.getComposedSchemas().getOneOf().isEmpty()) { + + List schemas = ModelUtils.getInterfaces(model); + List oneOfs = mdl.getComposedSchemas().getOneOf(); + if (oneOfs.size() != schemas.size()) { + // For safety reasons, this should never happen unless there is an error in the code + throw new RuntimeException("oneOf size does not match the model"); + } + + for (int i = 0; i < oneOfs.size(); i++) { + CodegenProperty oneOf = oneOfs.get(i); + Schema schema = schemas.get(i); + String aliasType = getTypeDeclaration(schema); + if (aliasType.startsWith("models::")) { + aliasType = aliasType.substring("models::".length()); + } + oneOf.setName(aliasType); + } + } + + return mdl; + } + @Override public ModelsMap postProcessModels(ModelsMap objs) { // Remove the discriminator field from the model, serde will take care of this for (ModelMap model : objs.getModels()) { + System.out.println("\nMODEL: \n\n"); + System.out.println(model); + System.out.println("\n\n\n"); + CodegenModel cm = model.getModel(); + if (cm.discriminator != null) { String reserved_var_name = cm.discriminator.getPropertyBaseName(); @@ -397,47 +432,6 @@ public String modelDocFileFolder() { return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar); } - @Override - public String getTypeDeclaration(Schema p) { - Schema unaliasSchema = unaliasSchema(p); - if (ModelUtils.isArraySchema(unaliasSchema)) { - ArraySchema ap = (ArraySchema) unaliasSchema; - Schema inner = ap.getItems(); - if (inner == null) { - LOGGER.warn("{}(array property) does not have a proper inner type defined.Default to string", - ap.getName()); - inner = new StringSchema().description("TODO default missing array inner type to string"); - } - return "Vec<" + getTypeDeclaration(inner) + ">"; - } else if (ModelUtils.isMapSchema(unaliasSchema)) { - Schema inner = ModelUtils.getAdditionalProperties(unaliasSchema); - if (inner == null) { - LOGGER.warn("{}(map property) does not have a proper inner type defined. Default to string", unaliasSchema.getName()); - inner = new StringSchema().description("TODO default missing map inner type to string"); - } - return "::std::collections::HashMap"; - } - - // Not using the supertype invocation, because we want to UpperCamelize - // the type. - String schemaType = getSchemaType(unaliasSchema); - if (typeMapping.containsKey(schemaType)) { - return typeMapping.get(schemaType); - } - - if (typeMapping.containsValue(schemaType)) { - return schemaType; - } - - if (languageSpecificPrimitives.contains(schemaType)) { - return schemaType; - } - - // return fully-qualified model name - // crate::models::{{classnameFile}}::{{classname}} - return "crate::models::" + toModelName(schemaType); - } - @Override public String getSchemaType(Schema p) { String schemaType = super.getSchemaType(p); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java index 2f34214da04e..2f2d9f074863 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java @@ -22,8 +22,6 @@ import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.ComposedSchema; -import io.swagger.v3.oas.models.media.FileSchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.XML; import io.swagger.v3.oas.models.parameters.Parameter; @@ -980,41 +978,6 @@ public CodegenParameter fromRequestBody(RequestBody body, Set imports, S return codegenParameter; } - @Override - public String getTypeDeclaration(Schema p) { - if (ModelUtils.isArraySchema(p)) { - ArraySchema ap = (ArraySchema) p; - Schema inner = ap.getItems(); - String innerType = getTypeDeclaration(inner); - return typeMapping.get("array") + "<" + innerType + ">"; - } else if (ModelUtils.isMapSchema(p)) { - Schema inner = ModelUtils.getAdditionalProperties(p); - String innerType = getTypeDeclaration(inner); - StringBuilder typeDeclaration = new StringBuilder(typeMapping.get("map")).append("<").append(typeMapping.get("string")).append(", "); - typeDeclaration.append(innerType).append(">"); - return typeDeclaration.toString(); - } else if (!StringUtils.isEmpty(p.get$ref())) { - String datatype; - try { - datatype = p.get$ref(); - - if (datatype.indexOf("#/components/schemas/") == 0) { - datatype = toModelName(datatype.substring("#/components/schemas/".length())); - datatype = "models::" + datatype; - } - } catch (Exception e) { - LOGGER.warn("Error obtaining the datatype from schema (model):{}. Datatype default to Object", p); - datatype = "Object"; - LOGGER.error(e.getMessage(), e); - } - return datatype; - } else if (p instanceof FileSchema) { - return typeMapping.get("File"); - } - - return super.getTypeDeclaration(p); - } - @Override public String toInstantiationType(Schema p) { if (ModelUtils.isArraySchema(p)) { @@ -1036,11 +999,6 @@ public CodegenModel fromModel(String name, Schema model) { Map allDefinitions = ModelUtils.getSchemas(this.openAPI); CodegenModel mdl = super.fromModel(name, model); - mdl.vendorExtensions.put("x-upper-case-name", name.toUpperCase(Locale.ROOT)); - if (!StringUtils.isEmpty(model.get$ref())) { - Schema schema = allDefinitions.get(ModelUtils.getSimpleRef(model.get$ref())); - mdl.dataType = typeMapping.get(schema.getType()); - } if (ModelUtils.isArraySchema(model)) { ArraySchema am = (ArraySchema) model; String xmlName = null; @@ -1070,12 +1028,6 @@ public CodegenModel fromModel(String name, Schema model) { mdl.vendorExtensions.put("x-item-xml-name", xmlName); modelXmlNames.put("models::" + mdl.classname, xmlName); } - - if (typeMapping.containsKey(mdl.arrayModelType)) { - mdl.arrayModelType = typeMapping.get(mdl.arrayModelType); - } else { - mdl.arrayModelType = toModelName(mdl.arrayModelType); - } } else if ((mdl.anyOf.size() > 0) || (mdl.oneOf.size() > 0)) { mdl.dataType = getSchemaType(model); } @@ -1084,12 +1036,6 @@ public CodegenModel fromModel(String name, Schema model) { additionalProperties.put("usesXmlNamespaces", true); } - Schema additionalProperties = ModelUtils.getAdditionalProperties(model); - - if (additionalProperties != null) { - mdl.additionalPropertiesType = getTypeDeclaration(additionalProperties); - } - LOGGER.trace("Created model: {}", mdl); return mdl; diff --git a/modules/openapi-generator/src/main/resources/rust/lib.mustache b/modules/openapi-generator/src/main/resources/rust/lib.mustache index cdc5287aae73..03ee005ea4c6 100644 --- a/modules/openapi-generator/src/main/resources/rust/lib.mustache +++ b/modules/openapi-generator/src/main/resources/rust/lib.mustache @@ -1,3 +1,5 @@ +#![allow(unused_imports)] + #[macro_use] extern crate serde_derive; diff --git a/modules/openapi-generator/src/main/resources/rust/model.mustache b/modules/openapi-generator/src/main/resources/rust/model.mustache index 73637837fb0a..d29d31fa01b8 100644 --- a/modules/openapi-generator/src/main/resources/rust/model.mustache +++ b/modules/openapi-generator/src/main/resources/rust/model.mustache @@ -1,12 +1,11 @@ +use crate::models; + {{>partial_header}} {{#models}} {{#model}} {{#description}} /// {{{classname}}} : {{{description}}} {{/description}} -{{#oneOf}} -use super::{{{.}}}; -{{/oneOf}} {{!-- for enum schemas --}} {{#isEnum}} @@ -61,17 +60,20 @@ pub enum {{{classname}}} { {{/mappedModels}} {{/oneOf}} {{^oneOf.isEmpty}} + {{#mappedModels}} {{#description}} /// {{{.}}} {{/description}} - {{#mappedModels}} #[serde(rename="{{mappingName}}")] {{{modelName}}}(Box<{{{modelName}}}>), {{/mappedModels}} {{^mappedModels}} - {{#oneOf}} - {{{.}}}(Box<{{{.}}}>), - {{/oneOf}} + {{#composedSchemas.oneOf}} + {{#description}} + /// {{{.}}} + {{/description}} + {{{name}}}(Box<{{{dataType}}}>), + {{/composedSchemas.oneOf}} {{/mappedModels}} {{/oneOf.isEmpty}} } @@ -82,7 +84,12 @@ impl Default for {{classname}} { {{#vars}} {{{name}}}: Default::default(), {{/vars}} - }{{/-first}}{{/mappedModels}}{{/oneOf}}{{#oneOf}}{{#-first}}Self::{{{.}}}(Box::default()){{/-first}}{{/oneOf}} + }{{/-first}}{{/mappedModels}} + {{/oneOf}} + {{^oneOf.isEmpty}} + {{#mappedModels}}{{#-first}}Self::{{{modelName}}}(Box::default()){{/-first}}{{/mappedModels}} + {{^mappedModels}}{{#composedSchemas.oneOf}}{{#-first}}Self::{{{name}}}(Box::default()){{/-first}}{{/composedSchemas.oneOf}}{{/mappedModels}} + {{/oneOf.isEmpty}} } } @@ -118,20 +125,23 @@ impl {{{classname}}} { {{/oneOf.isEmpty}} {{^oneOf.isEmpty}} {{! TODO: add other vars that are not part of the oneOf}} +{{#description}} +/// {{{.}}} +{{/description}} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(untagged)] pub enum {{classname}} { - {{#oneOf}} +{{#composedSchemas.oneOf}} {{#description}} /// {{{.}}} {{/description}} - {{{.}}}(Box<{{{.}}}>), - {{/oneOf}} + {{{name}}}(Box<{{{dataType}}}>), +{{/composedSchemas.oneOf}} } impl Default for {{classname}} { fn default() -> Self { - {{#oneOf}}{{#-first}}Self::{{{.}}}(Box::default()){{/-first}}{{/oneOf}} + {{#composedSchemas.oneOf}}{{#-first}}Self::{{{name}}}(Box::default()){{/-first}}{{/composedSchemas.oneOf}} } } {{/oneOf.isEmpty}} diff --git a/samples/client/others/rust/hyper/composed-oneof/docs/DefaultApi.md b/samples/client/others/rust/hyper/composed-oneof/docs/DefaultApi.md index 65ae82fdec7a..c672b00c0648 100644 --- a/samples/client/others/rust/hyper/composed-oneof/docs/DefaultApi.md +++ b/samples/client/others/rust/hyper/composed-oneof/docs/DefaultApi.md @@ -39,7 +39,7 @@ No authorization required ## get_state -> crate::models::GetState200Response get_state() +> models::GetState200Response get_state() ### Parameters @@ -48,7 +48,7 @@ This endpoint does not need any parameter. ### Return type -[**crate::models::GetState200Response**](getState_200_response.md) +[**models::GetState200Response**](getState_200_response.md) ### Authorization diff --git a/samples/client/others/rust/hyper/composed-oneof/src/apis/default_api.rs b/samples/client/others/rust/hyper/composed-oneof/src/apis/default_api.rs index 19ded47e2b5e..bc7d7d735ecd 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/apis/default_api.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/apis/default_api.rs @@ -36,7 +36,7 @@ impl DefaultApiClient pub trait DefaultApi { fn create_state(&self, create_state_request: crate::models::CreateStateRequest) -> Pin>>>; - fn get_state(&self, ) -> Pin>>>; + fn get_state(&self, ) -> Pin>>>; } implDefaultApi for DefaultApiClient @@ -52,7 +52,7 @@ implDefaultApi for DefaultApiClient } #[allow(unused_mut)] - fn get_state(&self, ) -> Pin>>> { + fn get_state(&self, ) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::GET, "/state".to_string()) ; diff --git a/samples/client/others/rust/hyper/composed-oneof/src/lib.rs b/samples/client/others/rust/hyper/composed-oneof/src/lib.rs index a76d822525da..b49043ca0402 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/lib.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/lib.rs @@ -1,3 +1,5 @@ +#![allow(unused_imports)] + #[macro_use] extern crate serde_derive; diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs index 2fd5717a7f04..c44fba369433 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * oneOf test * @@ -8,8 +10,6 @@ * Generated by: https://openapi-generator.tech */ -use super::ObjA; -use super::ObjB; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -23,7 +23,8 @@ pub enum CreateStateRequest { impl Default for CreateStateRequest { fn default() -> Self { - Self::ObjA(Box::default()) + Self::ObjA(Box::default()) + } } diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs index c839b464e744..bf13e7602141 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * oneOf test * @@ -8,9 +10,6 @@ * Generated by: https://openapi-generator.tech */ -use super::ObjA; -use super::ObjB; -use super::ObjC; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -26,7 +25,8 @@ pub enum CustomOneOfArraySchemaInner { impl Default for CustomOneOfArraySchemaInner { fn default() -> Self { - Self::ObjA(Box::default()) + Self::ObjA(Box::default()) + } } diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs index 5ae9423ba88c..19e268847b7b 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * oneOf test * @@ -8,8 +10,6 @@ * Generated by: https://openapi-generator.tech */ -use super::ObjA; -use super::ObjB; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -23,7 +23,8 @@ pub enum CustomOneOfSchema { impl Default for CustomOneOfSchema { fn default() -> Self { - Self::ObjA(Box::default()) + Self::ObjA(Box::default()) + } } diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs index 8ae1d14d41dc..eaef8d61847b 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * oneOf test * @@ -8,9 +10,6 @@ * Generated by: https://openapi-generator.tech */ -use super::ObjA; -use super::ObjB; -use super::ObjD; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -26,7 +25,8 @@ pub enum GetState200Response { impl Default for GetState200Response { fn default() -> Self { - Self::ObjA(Box::default()) + Self::ObjA(Box::default()) + } } diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_a.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_a.rs index dc265f948346..bfcbfb3028c8 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_a.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_a.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * oneOf test * diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_b.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_b.rs index 0f664efd8bca..d905bb9722e3 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_b.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_b.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * oneOf test * diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_c.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_c.rs index 5aa6635e959c..b550e8d8fa00 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_c.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_c.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * oneOf test * diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_d.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_d.rs index 58101e561a84..f8cefe33c74b 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_d.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_d.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * oneOf test * diff --git a/samples/client/others/rust/hyper/emptyObject/docs/DefaultApi.md b/samples/client/others/rust/hyper/emptyObject/docs/DefaultApi.md index f0692c00673d..84f570faefd3 100644 --- a/samples/client/others/rust/hyper/emptyObject/docs/DefaultApi.md +++ b/samples/client/others/rust/hyper/emptyObject/docs/DefaultApi.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## endpoint_get -> crate::models::EmptyObject endpoint_get() +> models::EmptyObject endpoint_get() Get endpoint ### Parameters @@ -19,7 +19,7 @@ This endpoint does not need any parameter. ### Return type -[**crate::models::EmptyObject**](EmptyObject.md) +[**models::EmptyObject**](EmptyObject.md) ### Authorization diff --git a/samples/client/others/rust/hyper/emptyObject/src/apis/default_api.rs b/samples/client/others/rust/hyper/emptyObject/src/apis/default_api.rs index a1ea2c0cf6fa..3d6230b67041 100644 --- a/samples/client/others/rust/hyper/emptyObject/src/apis/default_api.rs +++ b/samples/client/others/rust/hyper/emptyObject/src/apis/default_api.rs @@ -35,13 +35,13 @@ impl DefaultApiClient } pub trait DefaultApi { - fn endpoint_get(&self, ) -> Pin>>>; + fn endpoint_get(&self, ) -> Pin>>>; } implDefaultApi for DefaultApiClient where C: Clone + std::marker::Send + Sync { #[allow(unused_mut)] - fn endpoint_get(&self, ) -> Pin>>> { + fn endpoint_get(&self, ) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::GET, "/endpoint".to_string()) ; diff --git a/samples/client/others/rust/hyper/emptyObject/src/lib.rs b/samples/client/others/rust/hyper/emptyObject/src/lib.rs index a76d822525da..b49043ca0402 100644 --- a/samples/client/others/rust/hyper/emptyObject/src/lib.rs +++ b/samples/client/others/rust/hyper/emptyObject/src/lib.rs @@ -1,3 +1,5 @@ +#![allow(unused_imports)] + #[macro_use] extern crate serde_derive; diff --git a/samples/client/others/rust/hyper/emptyObject/src/models/empty_object.rs b/samples/client/others/rust/hyper/emptyObject/src/models/empty_object.rs index cf42c3a6922f..06e27f51fcbc 100644 --- a/samples/client/others/rust/hyper/emptyObject/src/models/empty_object.rs +++ b/samples/client/others/rust/hyper/emptyObject/src/models/empty_object.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * EmptyObject * diff --git a/samples/client/others/rust/hyper/oneOf-array-map/.gitignore b/samples/client/others/rust/hyper/oneOf-array-map/.gitignore new file mode 100644 index 000000000000..6aa106405a4b --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-array-map/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/samples/client/others/rust/hyper/oneOf-array-map/.openapi-generator-ignore b/samples/client/others/rust/hyper/oneOf-array-map/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-array-map/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/others/rust/hyper/oneOf-array-map/.openapi-generator/FILES b/samples/client/others/rust/hyper/oneOf-array-map/.openapi-generator/FILES new file mode 100644 index 000000000000..bea8724de453 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-array-map/.openapi-generator/FILES @@ -0,0 +1,19 @@ +.gitignore +.travis.yml +Cargo.toml +README.md +docs/Apple.md +docs/DefaultApi.md +docs/Fruit.md +docs/Grape.md +git_push.sh +src/apis/client.rs +src/apis/configuration.rs +src/apis/default_api.rs +src/apis/mod.rs +src/apis/request.rs +src/lib.rs +src/models/apple.rs +src/models/fruit.rs +src/models/grape.rs +src/models/mod.rs diff --git a/samples/client/others/rust/hyper/oneOf-array-map/.openapi-generator/VERSION b/samples/client/others/rust/hyper/oneOf-array-map/.openapi-generator/VERSION new file mode 100644 index 000000000000..c9e125ba1880 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-array-map/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.4.0-SNAPSHOT diff --git a/samples/client/others/rust/hyper/oneOf-array-map/.travis.yml b/samples/client/others/rust/hyper/oneOf-array-map/.travis.yml new file mode 100644 index 000000000000..22761ba7ee19 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-array-map/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/samples/client/others/rust/hyper/oneOf-array-map/Cargo.toml b/samples/client/others/rust/hyper/oneOf-array-map/Cargo.toml new file mode 100644 index 000000000000..9b6c6d0bed38 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-array-map/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "oneof-array-map-hyper" +version = "0.0.1" +authors = ["OpenAPI Generator team and contributors"] +description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)" +# Override this license by providing a License Object in the OpenAPI. +license = "Unlicense" +edition = "2018" + +[dependencies] +serde = "^1.0" +serde_derive = "^1.0" +serde_json = "^1.0" +url = "^2.2" +uuid = { version = "^1.0", features = ["serde", "v4"] } +hyper = { version = "~0.14", features = ["full"] } +hyper-tls = "~0.5" +http = "~0.2" +base64 = "~0.7.0" +futures = "^0.3" diff --git a/samples/client/others/rust/hyper/oneOf-array-map/README.md b/samples/client/others/rust/hyper/oneOf-array-map/README.md new file mode 100644 index 000000000000..253f54c158da --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-array-map/README.md @@ -0,0 +1,48 @@ +# Rust API client for oneof-array-map-hyper + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 0.0.1 +- Package version: 0.0.1 +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `oneof-array-map-hyper` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +oneof-array-map-hyper = { path = "./oneof-array-map-hyper" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**root_get**](docs/DefaultApi.md#root_get) | **Get** / | +*DefaultApi* | [**test**](docs/DefaultApi.md#test) | **Put** / | + + +## Documentation For Models + + - [Apple](docs/Apple.md) + - [Fruit](docs/Fruit.md) + - [Grape](docs/Grape.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + + + diff --git a/samples/client/others/rust/hyper/oneOf-array-map/docs/Apple.md b/samples/client/others/rust/hyper/oneOf-array-map/docs/Apple.md new file mode 100644 index 000000000000..e36111582a86 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-array-map/docs/Apple.md @@ -0,0 +1,11 @@ +# Apple + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/others/rust/hyper/oneOf-array-map/docs/DefaultApi.md b/samples/client/others/rust/hyper/oneOf-array-map/docs/DefaultApi.md new file mode 100644 index 000000000000..d71db693a606 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-array-map/docs/DefaultApi.md @@ -0,0 +1,63 @@ +# \DefaultApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**root_get**](DefaultApi.md#root_get) | **Get** / | +[**test**](DefaultApi.md#test) | **Put** / | + + + +## root_get + +> models::Fruit root_get() + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::Fruit**](fruit.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## test + +> test(body) + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**body** | Option<**serde_json::Value**> | | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/others/rust/hyper/oneOf-array-map/docs/Fruit.md b/samples/client/others/rust/hyper/oneOf-array-map/docs/Fruit.md new file mode 100644 index 000000000000..02d10609d0ae --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-array-map/docs/Fruit.md @@ -0,0 +1,12 @@ +# Fruit + +## Enum Variants + +| Name | Description | +|---- | -----| +| Vec | | +| std::collections::HashMap | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/others/rust/hyper/oneOf-array-map/docs/Grape.md b/samples/client/others/rust/hyper/oneOf-array-map/docs/Grape.md new file mode 100644 index 000000000000..faa52f26b020 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-array-map/docs/Grape.md @@ -0,0 +1,11 @@ +# Grape + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/others/rust/hyper/oneOf-array-map/git_push.sh b/samples/client/others/rust/hyper/oneOf-array-map/git_push.sh new file mode 100644 index 000000000000..f53a75d4fabe --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-array-map/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/apis/client.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/apis/client.rs new file mode 100644 index 000000000000..021112f848c8 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/apis/client.rs @@ -0,0 +1,24 @@ +use std::rc::Rc; + +use hyper; +use super::configuration::Configuration; + +pub struct APIClient { + default_api: Box, +} + +impl APIClient { + pub fn new(configuration: Configuration) -> APIClient + where C: Clone + std::marker::Send + Sync + 'static { + let rc = Rc::new(configuration); + + APIClient { + default_api: Box::new(crate::apis::DefaultApiClient::new(rc.clone())), + } + } + + pub fn default_api(&self) -> &dyn crate::apis::DefaultApi{ + self.default_api.as_ref() + } + +} diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/apis/configuration.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/apis/configuration.rs new file mode 100644 index 000000000000..4a2bb63cbef7 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/apis/configuration.rs @@ -0,0 +1,43 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +use hyper; + +pub struct Configuration + where C: Clone + std::marker::Send + Sync + 'static { + pub base_path: String, + pub user_agent: Option, + pub client: hyper::client::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub api_key: Option, + // TODO: take an oauth2 token source, similar to the go one +} + +pub type BasicAuth = (String, Option); + +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + +impl Configuration + where C: Clone + std::marker::Send + Sync { + pub fn new(client: hyper::client::Client) -> Configuration { + Configuration { + base_path: "http://localhost".to_owned(), + user_agent: Some("OpenAPI-Generator/0.0.1/rust".to_owned()), + client, + basic_auth: None, + oauth_access_token: None, + api_key: None, + } + } +} diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/apis/default_api.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/apis/default_api.rs new file mode 100644 index 000000000000..53653461d99f --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/apis/default_api.rs @@ -0,0 +1,62 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +use std::rc::Rc; +use std::borrow::Borrow; +use std::pin::Pin; +#[allow(unused_imports)] +use std::option::Option; + +use hyper; +use futures::Future; + +use super::{Error, configuration}; +use super::request as __internal_request; + +pub struct DefaultApiClient + where C: Clone + std::marker::Send + Sync + 'static { + configuration: Rc>, +} + +impl DefaultApiClient + where C: Clone + std::marker::Send + Sync { + pub fn new(configuration: Rc>) -> DefaultApiClient { + DefaultApiClient { + configuration, + } + } +} + +pub trait DefaultApi { + fn root_get(&self, ) -> Pin>>>; + fn test(&self, body: Option) -> Pin>>>; +} + +implDefaultApi for DefaultApiClient + where C: Clone + std::marker::Send + Sync { + #[allow(unused_mut)] + fn root_get(&self, ) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::GET, "/".to_string()) + ; + + req.execute(self.configuration.borrow()) + } + + #[allow(unused_mut)] + fn test(&self, body: Option) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::PUT, "/".to_string()) + ; + req = req.with_body_param(body); + req = req.returns_nothing(); + + req.execute(self.configuration.borrow()) + } + +} diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/apis/mod.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/apis/mod.rs new file mode 100644 index 000000000000..1a5b2f58e4b9 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/apis/mod.rs @@ -0,0 +1,54 @@ +use http; +use hyper; +use serde_json; + +#[derive(Debug)] +pub enum Error { + Api(ApiError), + Header(hyper::http::header::InvalidHeaderValue), + Http(http::Error), + Hyper(hyper::Error), + Serde(serde_json::Error), + UriError(http::uri::InvalidUri), +} + +#[derive(Debug)] +pub struct ApiError { + pub code: hyper::StatusCode, + pub body: hyper::body::Body, +} + +impl From<(hyper::StatusCode, hyper::body::Body)> for Error { + fn from(e: (hyper::StatusCode, hyper::body::Body)) -> Self { + Error::Api(ApiError { + code: e.0, + body: e.1, + }) + } +} + +impl From for Error { + fn from(e: http::Error) -> Self { + return Error::Http(e) + } +} + +impl From for Error { + fn from(e: hyper::Error) -> Self { + return Error::Hyper(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + return Error::Serde(e) + } +} + +mod request; + +mod default_api; +pub use self::default_api::{ DefaultApi, DefaultApiClient }; + +pub mod configuration; +pub mod client; diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/apis/request.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/apis/request.rs new file mode 100644 index 000000000000..db4d55e47b1e --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/apis/request.rs @@ -0,0 +1,242 @@ +use std::collections::HashMap; +use std::pin::Pin; + +use futures; +use futures::Future; +use futures::future::*; +use hyper; +use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, HeaderValue, USER_AGENT}; +use serde; +use serde_json; + +use super::{configuration, Error}; + +pub(crate) struct ApiKey { + pub in_header: bool, + pub in_query: bool, + pub param_name: String, +} + +impl ApiKey { + fn key(&self, prefix: &Option, key: &str) -> String { + match prefix { + None => key.to_owned(), + Some(ref prefix) => format!("{} {}", prefix, key), + } + } +} + +#[allow(dead_code)] +pub(crate) enum Auth { + None, + ApiKey(ApiKey), + Basic, + Oauth, +} + +/// If the authorization type is unspecified then it will be automatically detected based +/// on the configuration. This functionality is useful when the OpenAPI definition does not +/// include an authorization scheme. +pub(crate) struct Request { + auth: Option, + method: hyper::Method, + path: String, + query_params: HashMap, + no_return_type: bool, + path_params: HashMap, + form_params: HashMap, + header_params: HashMap, + // TODO: multiple body params are possible technically, but not supported here. + serialized_body: Option, +} + +#[allow(dead_code)] +impl Request { + pub fn new(method: hyper::Method, path: String) -> Self { + Request { + auth: None, + method, + path, + query_params: HashMap::new(), + path_params: HashMap::new(), + form_params: HashMap::new(), + header_params: HashMap::new(), + serialized_body: None, + no_return_type: false, + } + } + + pub fn with_body_param(mut self, param: T) -> Self { + self.serialized_body = Some(serde_json::to_string(¶m).unwrap()); + self + } + + pub fn with_header_param(mut self, basename: String, param: String) -> Self { + self.header_params.insert(basename, param); + self + } + + #[allow(unused)] + pub fn with_query_param(mut self, basename: String, param: String) -> Self { + self.query_params.insert(basename, param); + self + } + + #[allow(unused)] + pub fn with_path_param(mut self, basename: String, param: String) -> Self { + self.path_params.insert(basename, param); + self + } + + #[allow(unused)] + pub fn with_form_param(mut self, basename: String, param: String) -> Self { + self.form_params.insert(basename, param); + self + } + + pub fn returns_nothing(mut self) -> Self { + self.no_return_type = true; + self + } + + pub fn with_auth(mut self, auth: Auth) -> Self { + self.auth = Some(auth); + self + } + + pub fn execute<'a, C, U>( + self, + conf: &configuration::Configuration, + ) -> Pin> + 'a>> + where + C: hyper::client::connect::Connect + Clone + std::marker::Send + Sync, + U: Sized + std::marker::Send + 'a, + for<'de> U: serde::Deserialize<'de>, + { + let mut query_string = ::url::form_urlencoded::Serializer::new("".to_owned()); + + let mut path = self.path; + for (k, v) in self.path_params { + // replace {id} with the value of the id path param + path = path.replace(&format!("{{{}}}", k), &v); + } + + for (key, val) in self.query_params { + query_string.append_pair(&key, &val); + } + + let mut uri_str = format!("{}{}", conf.base_path, path); + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri_str += "?"; + uri_str += &query_string_str; + } + let uri: hyper::Uri = match uri_str.parse() { + Err(e) => return Box::pin(futures::future::err(Error::UriError(e))), + Ok(u) => u, + }; + + let mut req_builder = hyper::Request::builder() + .uri(uri) + .method(self.method); + + // Detect the authorization type if it hasn't been set. + let auth = self.auth.unwrap_or_else(|| + if conf.api_key.is_some() { + panic!("Cannot automatically set the API key from the configuration, it must be specified in the OpenAPI definition") + } else if conf.oauth_access_token.is_some() { + Auth::Oauth + } else if conf.basic_auth.is_some() { + Auth::Basic + } else { + Auth::None + } + ); + match auth { + Auth::ApiKey(apikey) => { + if let Some(ref key) = conf.api_key { + let val = apikey.key(&key.prefix, &key.key); + if apikey.in_query { + query_string.append_pair(&apikey.param_name, &val); + } + if apikey.in_header { + req_builder = req_builder.header(&apikey.param_name, val); + } + } + } + Auth::Basic => { + if let Some(ref auth_conf) = conf.basic_auth { + let mut text = auth_conf.0.clone(); + text.push(':'); + if let Some(ref pass) = auth_conf.1 { + text.push_str(&pass[..]); + } + let encoded = base64::encode(&text); + req_builder = req_builder.header(AUTHORIZATION, encoded); + } + } + Auth::Oauth => { + if let Some(ref token) = conf.oauth_access_token { + let text = "Bearer ".to_owned() + token; + req_builder = req_builder.header(AUTHORIZATION, text); + } + } + Auth::None => {} + } + + if let Some(ref user_agent) = conf.user_agent { + req_builder = req_builder.header(USER_AGENT, match HeaderValue::from_str(user_agent) { + Ok(header_value) => header_value, + Err(e) => return Box::pin(futures::future::err(super::Error::Header(e))) + }); + } + + for (k, v) in self.header_params { + req_builder = req_builder.header(&k, v); + } + + let req_headers = req_builder.headers_mut().unwrap(); + let request_result = if self.form_params.len() > 0 { + req_headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/x-www-form-urlencoded")); + let mut enc = ::url::form_urlencoded::Serializer::new("".to_owned()); + for (k, v) in self.form_params { + enc.append_pair(&k, &v); + } + req_builder.body(hyper::Body::from(enc.finish())) + } else if let Some(body) = self.serialized_body { + req_headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/json")); + req_headers.insert(CONTENT_LENGTH, body.len().into()); + req_builder.body(hyper::Body::from(body)) + } else { + req_builder.body(hyper::Body::default()) + }; + let request = match request_result { + Ok(request) => request, + Err(e) => return Box::pin(futures::future::err(Error::from(e))) + }; + + let no_return_type = self.no_return_type; + Box::pin(conf.client + .request(request) + .map_err(|e| Error::from(e)) + .and_then(move |response| { + let status = response.status(); + if !status.is_success() { + futures::future::err::(Error::from((status, response.into_body()))).boxed() + } else if no_return_type { + // This is a hack; if there's no_ret_type, U is (), but serde_json gives an + // error when deserializing "" into (), so deserialize 'null' into it + // instead. + // An alternate option would be to require U: Default, and then return + // U::default() here instead since () implements that, but then we'd + // need to impl default for all models. + futures::future::ok::(serde_json::from_str("null").expect("serde null value")).boxed() + } else { + hyper::body::to_bytes(response.into_body()) + .map(|bytes| serde_json::from_slice(&bytes.unwrap())) + .map_err(|e| Error::from(e)).boxed() + } + })) + } +} diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/lib.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/lib.rs new file mode 100644 index 000000000000..b49043ca0402 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/lib.rs @@ -0,0 +1,13 @@ +#![allow(unused_imports)] + +#[macro_use] +extern crate serde_derive; + +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate hyper; +extern crate futures; + +pub mod apis; +pub mod models; diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/models/apple.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/models/apple.rs new file mode 100644 index 000000000000..2df6d0e08e59 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/models/apple.rs @@ -0,0 +1,30 @@ +use crate::models; + +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Apple { + #[serde(rename = "kind", skip_serializing_if = "Option::is_none")] + pub kind: Option, +} + +impl Apple { + pub fn new() -> Apple { + Apple { + kind: None, + } + } +} + + diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/models/fruit.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/models/fruit.rs new file mode 100644 index 000000000000..2247f085851e --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/models/fruit.rs @@ -0,0 +1,29 @@ +use crate::models; + +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum Fruit { + Apples(Box>), + Grapes(Box>), +} + +impl Default for Fruit { + fn default() -> Self { + Self::Apples(Box::default()) + } +} + + diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/models/grape.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/models/grape.rs new file mode 100644 index 000000000000..86ead6847095 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/models/grape.rs @@ -0,0 +1,30 @@ +use crate::models; + +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Grape { + #[serde(rename = "color", skip_serializing_if = "Option::is_none")] + pub color: Option, +} + +impl Grape { + pub fn new() -> Grape { + Grape { + color: None, + } + } +} + + diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/models/mod.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/models/mod.rs new file mode 100644 index 000000000000..f5abecafddb5 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/models/mod.rs @@ -0,0 +1,6 @@ +pub mod apple; +pub use self::apple::Apple; +pub mod fruit; +pub use self::fruit::Fruit; +pub mod grape; +pub use self::grape::Grape; diff --git a/samples/client/others/rust/hyper/oneOf/docs/Bar.md b/samples/client/others/rust/hyper/oneOf/docs/Bar.md index e923f9d0dfb4..188b551a0f92 100644 --- a/samples/client/others/rust/hyper/oneOf/docs/Bar.md +++ b/samples/client/others/rust/hyper/oneOf/docs/Bar.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **id** | **String** | | **bar_prop_a** | Option<**String**> | | [optional] **foo_prop_b** | Option<**String**> | | [optional] -**foo** | Option<[**crate::models::FooRefOrValue**](FooRefOrValue.md)> | | [optional] +**foo** | Option<[**models::FooRefOrValue**](FooRefOrValue.md)> | | [optional] **href** | Option<**String**> | Hyperlink reference | [optional] **at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional] diff --git a/samples/client/others/rust/hyper/oneOf/docs/BarApi.md b/samples/client/others/rust/hyper/oneOf/docs/BarApi.md index 13cec7905323..76d66d2941c3 100644 --- a/samples/client/others/rust/hyper/oneOf/docs/BarApi.md +++ b/samples/client/others/rust/hyper/oneOf/docs/BarApi.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## create_bar -> crate::models::Bar create_bar(bar_create) +> models::Bar create_bar(bar_create) Create a Bar ### Parameters @@ -22,7 +22,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Bar**](Bar.md) +[**models::Bar**](Bar.md) ### Authorization diff --git a/samples/client/others/rust/hyper/oneOf/docs/BarCreate.md b/samples/client/others/rust/hyper/oneOf/docs/BarCreate.md index 47eb6b9c3bef..f03857dc29b8 100644 --- a/samples/client/others/rust/hyper/oneOf/docs/BarCreate.md +++ b/samples/client/others/rust/hyper/oneOf/docs/BarCreate.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **bar_prop_a** | Option<**String**> | | [optional] **foo_prop_b** | Option<**String**> | | [optional] -**foo** | Option<[**crate::models::FooRefOrValue**](FooRefOrValue.md)> | | [optional] +**foo** | Option<[**models::FooRefOrValue**](FooRefOrValue.md)> | | [optional] **href** | Option<**String**> | Hyperlink reference | [optional] **id** | Option<**String**> | unique identifier | [optional] **at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] diff --git a/samples/client/others/rust/hyper/oneOf/docs/FooApi.md b/samples/client/others/rust/hyper/oneOf/docs/FooApi.md index 459ccef2909f..072a13344429 100644 --- a/samples/client/others/rust/hyper/oneOf/docs/FooApi.md +++ b/samples/client/others/rust/hyper/oneOf/docs/FooApi.md @@ -11,7 +11,7 @@ Method | HTTP request | Description ## create_foo -> crate::models::FooRefOrValue create_foo(foo) +> models::FooRefOrValue create_foo(foo) Create a Foo ### Parameters @@ -23,7 +23,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::FooRefOrValue**](FooRefOrValue.md) +[**models::FooRefOrValue**](FooRefOrValue.md) ### Authorization @@ -39,7 +39,7 @@ No authorization required ## get_all_foos -> Vec get_all_foos() +> Vec get_all_foos() GET all Foos ### Parameters @@ -48,7 +48,7 @@ This endpoint does not need any parameter. ### Return type -[**Vec**](FooRefOrValue.md) +[**Vec**](FooRefOrValue.md) ### Authorization diff --git a/samples/client/others/rust/hyper/oneOf/docs/Pizza.md b/samples/client/others/rust/hyper/oneOf/docs/Pizza.md index 4f01417f1187..4e4638422e2d 100644 --- a/samples/client/others/rust/hyper/oneOf/docs/Pizza.md +++ b/samples/client/others/rust/hyper/oneOf/docs/Pizza.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pizza_size** | Option<**f32**> | | [optional] +**pizza_size** | Option<**f64**> | | [optional] **href** | Option<**String**> | Hyperlink reference | [optional] **id** | Option<**String**> | unique identifier | [optional] **at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] diff --git a/samples/client/others/rust/hyper/oneOf/docs/PizzaSpeziale.md b/samples/client/others/rust/hyper/oneOf/docs/PizzaSpeziale.md index 961ac04afe46..c02246e8e0db 100644 --- a/samples/client/others/rust/hyper/oneOf/docs/PizzaSpeziale.md +++ b/samples/client/others/rust/hyper/oneOf/docs/PizzaSpeziale.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **toppings** | Option<**String**> | | [optional] -**pizza_size** | Option<**f32**> | | [optional] +**pizza_size** | Option<**f64**> | | [optional] **href** | Option<**String**> | Hyperlink reference | [optional] **id** | Option<**String**> | unique identifier | [optional] **at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] diff --git a/samples/client/others/rust/hyper/oneOf/src/apis/bar_api.rs b/samples/client/others/rust/hyper/oneOf/src/apis/bar_api.rs index 9d0d838b95a4..27db239cdc86 100644 --- a/samples/client/others/rust/hyper/oneOf/src/apis/bar_api.rs +++ b/samples/client/others/rust/hyper/oneOf/src/apis/bar_api.rs @@ -35,13 +35,13 @@ impl BarApiClient } pub trait BarApi { - fn create_bar(&self, bar_create: crate::models::BarCreate) -> Pin>>>; + fn create_bar(&self, bar_create: crate::models::BarCreate) -> Pin>>>; } implBarApi for BarApiClient where C: Clone + std::marker::Send + Sync { #[allow(unused_mut)] - fn create_bar(&self, bar_create: crate::models::BarCreate) -> Pin>>> { + fn create_bar(&self, bar_create: crate::models::BarCreate) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::POST, "/bar".to_string()) ; req = req.with_body_param(bar_create); diff --git a/samples/client/others/rust/hyper/oneOf/src/apis/foo_api.rs b/samples/client/others/rust/hyper/oneOf/src/apis/foo_api.rs index e9ac63e81ee8..e3b6de5b371f 100644 --- a/samples/client/others/rust/hyper/oneOf/src/apis/foo_api.rs +++ b/samples/client/others/rust/hyper/oneOf/src/apis/foo_api.rs @@ -35,14 +35,14 @@ impl FooApiClient } pub trait FooApi { - fn create_foo(&self, foo: Option) -> Pin>>>; - fn get_all_foos(&self, ) -> Pin, Error>>>>; + fn create_foo(&self, foo: Option) -> Pin>>>; + fn get_all_foos(&self, ) -> Pin, Error>>>>; } implFooApi for FooApiClient where C: Clone + std::marker::Send + Sync { #[allow(unused_mut)] - fn create_foo(&self, foo: Option) -> Pin>>> { + fn create_foo(&self, foo: Option) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::POST, "/foo".to_string()) ; req = req.with_body_param(foo); @@ -51,7 +51,7 @@ implFooApi for FooApiClient } #[allow(unused_mut)] - fn get_all_foos(&self, ) -> Pin, Error>>>> { + fn get_all_foos(&self, ) -> Pin, Error>>>> { let mut req = __internal_request::Request::new(hyper::Method::GET, "/foo".to_string()) ; diff --git a/samples/client/others/rust/hyper/oneOf/src/lib.rs b/samples/client/others/rust/hyper/oneOf/src/lib.rs index a76d822525da..b49043ca0402 100644 --- a/samples/client/others/rust/hyper/oneOf/src/lib.rs +++ b/samples/client/others/rust/hyper/oneOf/src/lib.rs @@ -1,3 +1,5 @@ +#![allow(unused_imports)] + #[macro_use] extern crate serde_derive; diff --git a/samples/client/others/rust/hyper/oneOf/src/models/addressable.rs b/samples/client/others/rust/hyper/oneOf/src/models/addressable.rs index 1110f9bd0aa5..d365468f53c0 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/addressable.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/addressable.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * diff --git a/samples/client/others/rust/hyper/oneOf/src/models/apple.rs b/samples/client/others/rust/hyper/oneOf/src/models/apple.rs index dd244a933f1b..6c17e35c43bd 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/apple.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/apple.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * diff --git a/samples/client/others/rust/hyper/oneOf/src/models/banana.rs b/samples/client/others/rust/hyper/oneOf/src/models/banana.rs index 8330cc76c6c1..61cbcfddce28 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/banana.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/banana.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * diff --git a/samples/client/others/rust/hyper/oneOf/src/models/bar.rs b/samples/client/others/rust/hyper/oneOf/src/models/bar.rs index 0d25ee987774..0a4b4d517171 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/bar.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/bar.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * @@ -20,7 +22,7 @@ pub struct Bar { #[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")] pub foo_prop_b: Option, #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] - pub foo: Option>, + pub foo: Option>, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] pub href: Option, diff --git a/samples/client/others/rust/hyper/oneOf/src/models/bar_create.rs b/samples/client/others/rust/hyper/oneOf/src/models/bar_create.rs index 950642d7dce3..0c5a4120fa5d 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/bar_create.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/bar_create.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * @@ -18,7 +20,7 @@ pub struct BarCreate { #[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")] pub foo_prop_b: Option, #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] - pub foo: Option>, + pub foo: Option>, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] pub href: Option, diff --git a/samples/client/others/rust/hyper/oneOf/src/models/bar_ref.rs b/samples/client/others/rust/hyper/oneOf/src/models/bar_ref.rs index 9c671a320c03..fbd547e391e2 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/bar_ref.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/bar_ref.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * diff --git a/samples/client/others/rust/hyper/oneOf/src/models/bar_ref_or_value.rs b/samples/client/others/rust/hyper/oneOf/src/models/bar_ref_or_value.rs index f7a595f0cd36..23325007ab20 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/bar_ref_or_value.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/bar_ref_or_value.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * @@ -8,16 +10,14 @@ * Generated by: https://openapi-generator.tech */ -use super::Bar; -use super::BarRef; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(untagged)] pub enum BarRefOrValue { - Bar(Box), - BarRef(Box), + Bar(Box), + BarRef(Box), } impl Default for BarRefOrValue { diff --git a/samples/client/others/rust/hyper/oneOf/src/models/entity.rs b/samples/client/others/rust/hyper/oneOf/src/models/entity.rs index 6636ab6bd9de..53df00de0837 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/entity.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/entity.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * diff --git a/samples/client/others/rust/hyper/oneOf/src/models/entity_ref.rs b/samples/client/others/rust/hyper/oneOf/src/models/entity_ref.rs index 6a2f4b8da227..19b05eb50eb6 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/entity_ref.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/entity_ref.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * diff --git a/samples/client/others/rust/hyper/oneOf/src/models/extensible.rs b/samples/client/others/rust/hyper/oneOf/src/models/extensible.rs index 65b776949652..d3061ab36cc1 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/extensible.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/extensible.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * diff --git a/samples/client/others/rust/hyper/oneOf/src/models/foo.rs b/samples/client/others/rust/hyper/oneOf/src/models/foo.rs index 4b865bfa7dcc..546608178e20 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/foo.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/foo.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * diff --git a/samples/client/others/rust/hyper/oneOf/src/models/foo_ref.rs b/samples/client/others/rust/hyper/oneOf/src/models/foo_ref.rs index fb28017bd08d..bf47bf393c60 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/foo_ref.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/foo_ref.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * diff --git a/samples/client/others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs b/samples/client/others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs index 8e0b9e188e10..1e2051ca199c 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * @@ -8,19 +10,18 @@ * Generated by: https://openapi-generator.tech */ -use super::Foo; -use super::FooRef; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "@type")] pub enum FooRefOrValue { - Foo(Box), - FooRef(Box), + Foo(Box), + FooRef(Box), } impl Default for FooRefOrValue { fn default() -> Self { + Self::Foo(Box::default()) } } diff --git a/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs b/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs index d9bc5e23d479..ee9c2ca65a7a 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * @@ -8,8 +10,6 @@ * Generated by: https://openapi-generator.tech */ -use super::Apple; -use super::Banana; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -23,7 +23,8 @@ pub enum Fruit { impl Default for Fruit { fn default() -> Self { - Self::Apple(Box::default()) + Self::Apple(Box::default()) + } } diff --git a/samples/client/others/rust/hyper/oneOf/src/models/fruit_type.rs b/samples/client/others/rust/hyper/oneOf/src/models/fruit_type.rs index 3927e1805e1e..b300d992a636 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/fruit_type.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/fruit_type.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * diff --git a/samples/client/others/rust/hyper/oneOf/src/models/pasta.rs b/samples/client/others/rust/hyper/oneOf/src/models/pasta.rs index 11f64426bbe0..36652331311b 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/pasta.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/pasta.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * diff --git a/samples/client/others/rust/hyper/oneOf/src/models/pizza.rs b/samples/client/others/rust/hyper/oneOf/src/models/pizza.rs index 571ef0a674ee..fcf98581fbd6 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/pizza.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/pizza.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * @@ -14,7 +16,7 @@ #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Pizza { #[serde(rename = "pizzaSize", skip_serializing_if = "Option::is_none")] - pub pizza_size: Option, + pub pizza_size: Option, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] pub href: Option, diff --git a/samples/client/others/rust/hyper/oneOf/src/models/pizza_speziale.rs b/samples/client/others/rust/hyper/oneOf/src/models/pizza_speziale.rs index a7ee348297ce..ff82c9a3bc5e 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/pizza_speziale.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/pizza_speziale.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * @@ -16,7 +18,7 @@ pub struct PizzaSpeziale { #[serde(rename = "toppings", skip_serializing_if = "Option::is_none")] pub toppings: Option, #[serde(rename = "pizzaSize", skip_serializing_if = "Option::is_none")] - pub pizza_size: Option, + pub pizza_size: Option, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] pub href: Option, diff --git a/samples/client/others/rust/reqwest-regression-16119/docs/DefaultApi.md b/samples/client/others/rust/reqwest-regression-16119/docs/DefaultApi.md index 97e04bf99aa5..299074842729 100644 --- a/samples/client/others/rust/reqwest-regression-16119/docs/DefaultApi.md +++ b/samples/client/others/rust/reqwest-regression-16119/docs/DefaultApi.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## repro -> crate::models::Parent repro() +> models::Parent repro() ### Parameters @@ -19,7 +19,7 @@ This endpoint does not need any parameter. ### Return type -[**crate::models::Parent**](Parent.md) +[**models::Parent**](Parent.md) ### Authorization diff --git a/samples/client/others/rust/reqwest-regression-16119/docs/Parent.md b/samples/client/others/rust/reqwest-regression-16119/docs/Parent.md index fef8469c1703..a0c675cd43cd 100644 --- a/samples/client/others/rust/reqwest-regression-16119/docs/Parent.md +++ b/samples/client/others/rust/reqwest-regression-16119/docs/Parent.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**child** | Option<[**::std::collections::HashMap**](serde_json::Value.md)> | | [optional] +**child** | Option<[**std::collections::HashMap**](serde_json::Value.md)> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/others/rust/reqwest-regression-16119/src/apis/default_api.rs b/samples/client/others/rust/reqwest-regression-16119/src/apis/default_api.rs index 8e88609ed8be..297c900efd2e 100644 --- a/samples/client/others/rust/reqwest-regression-16119/src/apis/default_api.rs +++ b/samples/client/others/rust/reqwest-regression-16119/src/apis/default_api.rs @@ -23,7 +23,7 @@ pub enum ReproError { } -pub fn repro(configuration: &configuration::Configuration, ) -> Result> { +pub fn repro(configuration: &configuration::Configuration, ) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/samples/client/others/rust/reqwest-regression-16119/src/lib.rs b/samples/client/others/rust/reqwest-regression-16119/src/lib.rs index c1dd666f7957..1ac114198fdd 100644 --- a/samples/client/others/rust/reqwest-regression-16119/src/lib.rs +++ b/samples/client/others/rust/reqwest-regression-16119/src/lib.rs @@ -1,3 +1,5 @@ +#![allow(unused_imports)] + #[macro_use] extern crate serde_derive; diff --git a/samples/client/others/rust/reqwest-regression-16119/src/models/parent.rs b/samples/client/others/rust/reqwest-regression-16119/src/models/parent.rs index 536aff182f70..972fd4c7412f 100644 --- a/samples/client/others/rust/reqwest-regression-16119/src/models/parent.rs +++ b/samples/client/others/rust/reqwest-regression-16119/src/models/parent.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * double-option-hashmap * @@ -14,7 +16,7 @@ #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Parent { #[serde(rename = "child", skip_serializing_if = "Option::is_none")] - pub child: Option<::std::collections::HashMap>, + pub child: Option>, } impl Parent { diff --git a/samples/client/others/rust/reqwest/composed-oneof/docs/DefaultApi.md b/samples/client/others/rust/reqwest/composed-oneof/docs/DefaultApi.md index 328a4689d9f2..671b54b761b2 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/docs/DefaultApi.md +++ b/samples/client/others/rust/reqwest/composed-oneof/docs/DefaultApi.md @@ -39,7 +39,7 @@ No authorization required ## get_state -> crate::models::GetState200Response get_state() +> models::GetState200Response get_state() ### Parameters @@ -48,7 +48,7 @@ This endpoint does not need any parameter. ### Return type -[**crate::models::GetState200Response**](getState_200_response.md) +[**models::GetState200Response**](getState_200_response.md) ### Authorization diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/apis/default_api.rs b/samples/client/others/rust/reqwest/composed-oneof/src/apis/default_api.rs index 5f62777ee412..c227c76d414f 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/apis/default_api.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/apis/default_api.rs @@ -58,7 +58,7 @@ pub fn create_state(configuration: &configuration::Configuration, create_state_r } } -pub fn get_state(configuration: &configuration::Configuration, ) -> Result> { +pub fn get_state(configuration: &configuration::Configuration, ) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/lib.rs b/samples/client/others/rust/reqwest/composed-oneof/src/lib.rs index c1dd666f7957..1ac114198fdd 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/lib.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/lib.rs @@ -1,3 +1,5 @@ +#![allow(unused_imports)] + #[macro_use] extern crate serde_derive; diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs index 2fd5717a7f04..c44fba369433 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * oneOf test * @@ -8,8 +10,6 @@ * Generated by: https://openapi-generator.tech */ -use super::ObjA; -use super::ObjB; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -23,7 +23,8 @@ pub enum CreateStateRequest { impl Default for CreateStateRequest { fn default() -> Self { - Self::ObjA(Box::default()) + Self::ObjA(Box::default()) + } } diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs index c839b464e744..bf13e7602141 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * oneOf test * @@ -8,9 +10,6 @@ * Generated by: https://openapi-generator.tech */ -use super::ObjA; -use super::ObjB; -use super::ObjC; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -26,7 +25,8 @@ pub enum CustomOneOfArraySchemaInner { impl Default for CustomOneOfArraySchemaInner { fn default() -> Self { - Self::ObjA(Box::default()) + Self::ObjA(Box::default()) + } } diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs index 5ae9423ba88c..19e268847b7b 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * oneOf test * @@ -8,8 +10,6 @@ * Generated by: https://openapi-generator.tech */ -use super::ObjA; -use super::ObjB; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -23,7 +23,8 @@ pub enum CustomOneOfSchema { impl Default for CustomOneOfSchema { fn default() -> Self { - Self::ObjA(Box::default()) + Self::ObjA(Box::default()) + } } diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs index 8ae1d14d41dc..eaef8d61847b 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * oneOf test * @@ -8,9 +10,6 @@ * Generated by: https://openapi-generator.tech */ -use super::ObjA; -use super::ObjB; -use super::ObjD; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -26,7 +25,8 @@ pub enum GetState200Response { impl Default for GetState200Response { fn default() -> Self { - Self::ObjA(Box::default()) + Self::ObjA(Box::default()) + } } diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_a.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_a.rs index dc265f948346..bfcbfb3028c8 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_a.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_a.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * oneOf test * diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_b.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_b.rs index 0f664efd8bca..d905bb9722e3 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_b.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_b.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * oneOf test * diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_c.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_c.rs index 5aa6635e959c..b550e8d8fa00 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_c.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_c.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * oneOf test * diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_d.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_d.rs index 58101e561a84..f8cefe33c74b 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_d.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_d.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * oneOf test * diff --git a/samples/client/others/rust/reqwest/emptyObject/docs/DefaultApi.md b/samples/client/others/rust/reqwest/emptyObject/docs/DefaultApi.md index 7af86d20cc58..8f4a821642bf 100644 --- a/samples/client/others/rust/reqwest/emptyObject/docs/DefaultApi.md +++ b/samples/client/others/rust/reqwest/emptyObject/docs/DefaultApi.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## endpoint_get -> crate::models::EmptyObject endpoint_get() +> models::EmptyObject endpoint_get() Get endpoint ### Parameters @@ -19,7 +19,7 @@ This endpoint does not need any parameter. ### Return type -[**crate::models::EmptyObject**](EmptyObject.md) +[**models::EmptyObject**](EmptyObject.md) ### Authorization diff --git a/samples/client/others/rust/reqwest/emptyObject/src/apis/default_api.rs b/samples/client/others/rust/reqwest/emptyObject/src/apis/default_api.rs index 1d3cba5c67ef..9f118fb45449 100644 --- a/samples/client/others/rust/reqwest/emptyObject/src/apis/default_api.rs +++ b/samples/client/others/rust/reqwest/emptyObject/src/apis/default_api.rs @@ -23,7 +23,7 @@ pub enum EndpointGetError { } -pub fn endpoint_get(configuration: &configuration::Configuration, ) -> Result> { +pub fn endpoint_get(configuration: &configuration::Configuration, ) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/samples/client/others/rust/reqwest/emptyObject/src/lib.rs b/samples/client/others/rust/reqwest/emptyObject/src/lib.rs index c1dd666f7957..1ac114198fdd 100644 --- a/samples/client/others/rust/reqwest/emptyObject/src/lib.rs +++ b/samples/client/others/rust/reqwest/emptyObject/src/lib.rs @@ -1,3 +1,5 @@ +#![allow(unused_imports)] + #[macro_use] extern crate serde_derive; diff --git a/samples/client/others/rust/reqwest/emptyObject/src/models/empty_object.rs b/samples/client/others/rust/reqwest/emptyObject/src/models/empty_object.rs index cf42c3a6922f..06e27f51fcbc 100644 --- a/samples/client/others/rust/reqwest/emptyObject/src/models/empty_object.rs +++ b/samples/client/others/rust/reqwest/emptyObject/src/models/empty_object.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * EmptyObject * diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/.gitignore b/samples/client/others/rust/reqwest/oneOf-array-map/.gitignore new file mode 100644 index 000000000000..6aa106405a4b --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-array-map/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/.openapi-generator-ignore b/samples/client/others/rust/reqwest/oneOf-array-map/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-array-map/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/.openapi-generator/FILES b/samples/client/others/rust/reqwest/oneOf-array-map/.openapi-generator/FILES new file mode 100644 index 000000000000..176635bc3b2a --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-array-map/.openapi-generator/FILES @@ -0,0 +1,17 @@ +.gitignore +.travis.yml +Cargo.toml +README.md +docs/Apple.md +docs/DefaultApi.md +docs/Fruit.md +docs/Grape.md +git_push.sh +src/apis/configuration.rs +src/apis/default_api.rs +src/apis/mod.rs +src/lib.rs +src/models/apple.rs +src/models/fruit.rs +src/models/grape.rs +src/models/mod.rs diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/.openapi-generator/VERSION b/samples/client/others/rust/reqwest/oneOf-array-map/.openapi-generator/VERSION new file mode 100644 index 000000000000..c9e125ba1880 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-array-map/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.4.0-SNAPSHOT diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/.travis.yml b/samples/client/others/rust/reqwest/oneOf-array-map/.travis.yml new file mode 100644 index 000000000000..22761ba7ee19 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-array-map/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/Cargo.toml b/samples/client/others/rust/reqwest/oneOf-array-map/Cargo.toml new file mode 100644 index 000000000000..9d5cdb680318 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-array-map/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "oneof-array-map-reqwest" +version = "0.0.1" +authors = ["OpenAPI Generator team and contributors"] +description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)" +# Override this license by providing a License Object in the OpenAPI. +license = "Unlicense" +edition = "2018" + +[dependencies] +serde = "^1.0" +serde_derive = "^1.0" +serde_json = "^1.0" +url = "^2.2" +uuid = { version = "^1.0", features = ["serde", "v4"] } +[dependencies.reqwest] +version = "^0.11" +features = ["json", "blocking", "multipart"] diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/README.md b/samples/client/others/rust/reqwest/oneOf-array-map/README.md new file mode 100644 index 000000000000..f7124d2d06af --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-array-map/README.md @@ -0,0 +1,48 @@ +# Rust API client for oneof-array-map-reqwest + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 0.0.1 +- Package version: 0.0.1 +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `oneof-array-map-reqwest` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +oneof-array-map-reqwest = { path = "./oneof-array-map-reqwest" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**root_get**](docs/DefaultApi.md#root_get) | **GET** / | +*DefaultApi* | [**test**](docs/DefaultApi.md#test) | **PUT** / | + + +## Documentation For Models + + - [Apple](docs/Apple.md) + - [Fruit](docs/Fruit.md) + - [Grape](docs/Grape.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + + + diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/docs/Apple.md b/samples/client/others/rust/reqwest/oneOf-array-map/docs/Apple.md new file mode 100644 index 000000000000..e36111582a86 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-array-map/docs/Apple.md @@ -0,0 +1,11 @@ +# Apple + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/docs/DefaultApi.md b/samples/client/others/rust/reqwest/oneOf-array-map/docs/DefaultApi.md new file mode 100644 index 000000000000..d7fae1cddb6f --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-array-map/docs/DefaultApi.md @@ -0,0 +1,63 @@ +# \DefaultApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**root_get**](DefaultApi.md#root_get) | **GET** / | +[**test**](DefaultApi.md#test) | **PUT** / | + + + +## root_get + +> models::Fruit root_get() + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::Fruit**](fruit.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## test + +> test(body) + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**body** | Option<**serde_json::Value**> | | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/docs/Fruit.md b/samples/client/others/rust/reqwest/oneOf-array-map/docs/Fruit.md new file mode 100644 index 000000000000..02d10609d0ae --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-array-map/docs/Fruit.md @@ -0,0 +1,12 @@ +# Fruit + +## Enum Variants + +| Name | Description | +|---- | -----| +| Vec | | +| std::collections::HashMap | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/docs/Grape.md b/samples/client/others/rust/reqwest/oneOf-array-map/docs/Grape.md new file mode 100644 index 000000000000..faa52f26b020 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-array-map/docs/Grape.md @@ -0,0 +1,11 @@ +# Grape + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/git_push.sh b/samples/client/others/rust/reqwest/oneOf-array-map/git_push.sh new file mode 100644 index 000000000000..f53a75d4fabe --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-array-map/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/src/apis/configuration.rs b/samples/client/others/rust/reqwest/oneOf-array-map/src/apis/configuration.rs new file mode 100644 index 000000000000..affdc7fd52d6 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-array-map/src/apis/configuration.rs @@ -0,0 +1,53 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::blocking::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, + // TODO: take an oauth2 token source, similar to the go one +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "http://localhost".to_owned(), + user_agent: Some("OpenAPI-Generator/0.0.1/rust".to_owned()), + client: reqwest::blocking::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + + } + } +} diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/src/apis/default_api.rs b/samples/client/others/rust/reqwest/oneOf-array-map/src/apis/default_api.rs new file mode 100644 index 000000000000..004c4913a470 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-array-map/src/apis/default_api.rs @@ -0,0 +1,87 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; + +use crate::apis::ResponseContent; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`root_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RootGetError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`test`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TestError { + UnknownValue(serde_json::Value), +} + + +pub fn root_get(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req)?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text()?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub fn test(configuration: &configuration::Configuration, body: Option) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req)?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text()?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/src/apis/mod.rs b/samples/client/others/rust/reqwest/oneOf-array-map/src/apis/mod.rs new file mode 100644 index 000000000000..4b09ba50b401 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-array-map/src/apis/mod.rs @@ -0,0 +1,95 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +pub mod default_api; + +pub mod configuration; diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/src/lib.rs b/samples/client/others/rust/reqwest/oneOf-array-map/src/lib.rs new file mode 100644 index 000000000000..1ac114198fdd --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-array-map/src/lib.rs @@ -0,0 +1,12 @@ +#![allow(unused_imports)] + +#[macro_use] +extern crate serde_derive; + +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/src/models/apple.rs b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/apple.rs new file mode 100644 index 000000000000..2df6d0e08e59 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/apple.rs @@ -0,0 +1,30 @@ +use crate::models; + +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Apple { + #[serde(rename = "kind", skip_serializing_if = "Option::is_none")] + pub kind: Option, +} + +impl Apple { + pub fn new() -> Apple { + Apple { + kind: None, + } + } +} + + diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/src/models/fruit.rs b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/fruit.rs new file mode 100644 index 000000000000..2247f085851e --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/fruit.rs @@ -0,0 +1,29 @@ +use crate::models; + +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum Fruit { + Apples(Box>), + Grapes(Box>), +} + +impl Default for Fruit { + fn default() -> Self { + Self::Apples(Box::default()) + } +} + + diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/src/models/grape.rs b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/grape.rs new file mode 100644 index 000000000000..86ead6847095 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/grape.rs @@ -0,0 +1,30 @@ +use crate::models; + +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Grape { + #[serde(rename = "color", skip_serializing_if = "Option::is_none")] + pub color: Option, +} + +impl Grape { + pub fn new() -> Grape { + Grape { + color: None, + } + } +} + + diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/src/models/mod.rs b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/mod.rs new file mode 100644 index 000000000000..f5abecafddb5 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/mod.rs @@ -0,0 +1,6 @@ +pub mod apple; +pub use self::apple::Apple; +pub mod fruit; +pub use self::fruit::Fruit; +pub mod grape; +pub use self::grape::Grape; diff --git a/samples/client/others/rust/reqwest/oneOf/docs/Bar.md b/samples/client/others/rust/reqwest/oneOf/docs/Bar.md index e923f9d0dfb4..188b551a0f92 100644 --- a/samples/client/others/rust/reqwest/oneOf/docs/Bar.md +++ b/samples/client/others/rust/reqwest/oneOf/docs/Bar.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **id** | **String** | | **bar_prop_a** | Option<**String**> | | [optional] **foo_prop_b** | Option<**String**> | | [optional] -**foo** | Option<[**crate::models::FooRefOrValue**](FooRefOrValue.md)> | | [optional] +**foo** | Option<[**models::FooRefOrValue**](FooRefOrValue.md)> | | [optional] **href** | Option<**String**> | Hyperlink reference | [optional] **at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional] diff --git a/samples/client/others/rust/reqwest/oneOf/docs/BarApi.md b/samples/client/others/rust/reqwest/oneOf/docs/BarApi.md index f4a74a71edbe..e2d2e4b23f01 100644 --- a/samples/client/others/rust/reqwest/oneOf/docs/BarApi.md +++ b/samples/client/others/rust/reqwest/oneOf/docs/BarApi.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## create_bar -> crate::models::Bar create_bar(bar_create) +> models::Bar create_bar(bar_create) Create a Bar ### Parameters @@ -22,7 +22,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Bar**](Bar.md) +[**models::Bar**](Bar.md) ### Authorization diff --git a/samples/client/others/rust/reqwest/oneOf/docs/BarCreate.md b/samples/client/others/rust/reqwest/oneOf/docs/BarCreate.md index 47eb6b9c3bef..f03857dc29b8 100644 --- a/samples/client/others/rust/reqwest/oneOf/docs/BarCreate.md +++ b/samples/client/others/rust/reqwest/oneOf/docs/BarCreate.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **bar_prop_a** | Option<**String**> | | [optional] **foo_prop_b** | Option<**String**> | | [optional] -**foo** | Option<[**crate::models::FooRefOrValue**](FooRefOrValue.md)> | | [optional] +**foo** | Option<[**models::FooRefOrValue**](FooRefOrValue.md)> | | [optional] **href** | Option<**String**> | Hyperlink reference | [optional] **id** | Option<**String**> | unique identifier | [optional] **at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] diff --git a/samples/client/others/rust/reqwest/oneOf/docs/FooApi.md b/samples/client/others/rust/reqwest/oneOf/docs/FooApi.md index 8021946dd084..96829cfe91a2 100644 --- a/samples/client/others/rust/reqwest/oneOf/docs/FooApi.md +++ b/samples/client/others/rust/reqwest/oneOf/docs/FooApi.md @@ -11,7 +11,7 @@ Method | HTTP request | Description ## create_foo -> crate::models::FooRefOrValue create_foo(foo) +> models::FooRefOrValue create_foo(foo) Create a Foo ### Parameters @@ -23,7 +23,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::FooRefOrValue**](FooRefOrValue.md) +[**models::FooRefOrValue**](FooRefOrValue.md) ### Authorization @@ -39,7 +39,7 @@ No authorization required ## get_all_foos -> Vec get_all_foos() +> Vec get_all_foos() GET all Foos ### Parameters @@ -48,7 +48,7 @@ This endpoint does not need any parameter. ### Return type -[**Vec**](FooRefOrValue.md) +[**Vec**](FooRefOrValue.md) ### Authorization diff --git a/samples/client/others/rust/reqwest/oneOf/docs/Pizza.md b/samples/client/others/rust/reqwest/oneOf/docs/Pizza.md index 4f01417f1187..4e4638422e2d 100644 --- a/samples/client/others/rust/reqwest/oneOf/docs/Pizza.md +++ b/samples/client/others/rust/reqwest/oneOf/docs/Pizza.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pizza_size** | Option<**f32**> | | [optional] +**pizza_size** | Option<**f64**> | | [optional] **href** | Option<**String**> | Hyperlink reference | [optional] **id** | Option<**String**> | unique identifier | [optional] **at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] diff --git a/samples/client/others/rust/reqwest/oneOf/docs/PizzaSpeziale.md b/samples/client/others/rust/reqwest/oneOf/docs/PizzaSpeziale.md index 961ac04afe46..c02246e8e0db 100644 --- a/samples/client/others/rust/reqwest/oneOf/docs/PizzaSpeziale.md +++ b/samples/client/others/rust/reqwest/oneOf/docs/PizzaSpeziale.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **toppings** | Option<**String**> | | [optional] -**pizza_size** | Option<**f32**> | | [optional] +**pizza_size** | Option<**f64**> | | [optional] **href** | Option<**String**> | Hyperlink reference | [optional] **id** | Option<**String**> | unique identifier | [optional] **at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] diff --git a/samples/client/others/rust/reqwest/oneOf/src/apis/bar_api.rs b/samples/client/others/rust/reqwest/oneOf/src/apis/bar_api.rs index 4b4fa6282617..0025fe7913fb 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/apis/bar_api.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/apis/bar_api.rs @@ -23,7 +23,7 @@ pub enum CreateBarError { } -pub fn create_bar(configuration: &configuration::Configuration, bar_create: crate::models::BarCreate) -> Result> { +pub fn create_bar(configuration: &configuration::Configuration, bar_create: crate::models::BarCreate) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/samples/client/others/rust/reqwest/oneOf/src/apis/foo_api.rs b/samples/client/others/rust/reqwest/oneOf/src/apis/foo_api.rs index 3a3f20882dd1..f21b9a728087 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/apis/foo_api.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/apis/foo_api.rs @@ -30,7 +30,7 @@ pub enum GetAllFoosError { } -pub fn create_foo(configuration: &configuration::Configuration, foo: Option) -> Result> { +pub fn create_foo(configuration: &configuration::Configuration, foo: Option) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -58,7 +58,7 @@ pub fn create_foo(configuration: &configuration::Configuration, foo: Option Result, Error> { +pub fn get_all_foos(configuration: &configuration::Configuration, ) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/samples/client/others/rust/reqwest/oneOf/src/lib.rs b/samples/client/others/rust/reqwest/oneOf/src/lib.rs index c1dd666f7957..1ac114198fdd 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/lib.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/lib.rs @@ -1,3 +1,5 @@ +#![allow(unused_imports)] + #[macro_use] extern crate serde_derive; diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/addressable.rs b/samples/client/others/rust/reqwest/oneOf/src/models/addressable.rs index 1110f9bd0aa5..d365468f53c0 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/addressable.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/addressable.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/apple.rs b/samples/client/others/rust/reqwest/oneOf/src/models/apple.rs index dd244a933f1b..6c17e35c43bd 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/apple.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/apple.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/banana.rs b/samples/client/others/rust/reqwest/oneOf/src/models/banana.rs index 8330cc76c6c1..61cbcfddce28 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/banana.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/banana.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/bar.rs b/samples/client/others/rust/reqwest/oneOf/src/models/bar.rs index 0d25ee987774..0a4b4d517171 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/bar.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/bar.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * @@ -20,7 +22,7 @@ pub struct Bar { #[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")] pub foo_prop_b: Option, #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] - pub foo: Option>, + pub foo: Option>, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] pub href: Option, diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/bar_create.rs b/samples/client/others/rust/reqwest/oneOf/src/models/bar_create.rs index 950642d7dce3..0c5a4120fa5d 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/bar_create.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/bar_create.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * @@ -18,7 +20,7 @@ pub struct BarCreate { #[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")] pub foo_prop_b: Option, #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] - pub foo: Option>, + pub foo: Option>, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] pub href: Option, diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref.rs b/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref.rs index 9c671a320c03..fbd547e391e2 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref_or_value.rs b/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref_or_value.rs index f7a595f0cd36..23325007ab20 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref_or_value.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref_or_value.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * @@ -8,16 +10,14 @@ * Generated by: https://openapi-generator.tech */ -use super::Bar; -use super::BarRef; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(untagged)] pub enum BarRefOrValue { - Bar(Box), - BarRef(Box), + Bar(Box), + BarRef(Box), } impl Default for BarRefOrValue { diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/entity.rs b/samples/client/others/rust/reqwest/oneOf/src/models/entity.rs index 6636ab6bd9de..53df00de0837 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/entity.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/entity.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/entity_ref.rs b/samples/client/others/rust/reqwest/oneOf/src/models/entity_ref.rs index 6a2f4b8da227..19b05eb50eb6 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/entity_ref.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/entity_ref.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/extensible.rs b/samples/client/others/rust/reqwest/oneOf/src/models/extensible.rs index 65b776949652..d3061ab36cc1 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/extensible.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/extensible.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/foo.rs b/samples/client/others/rust/reqwest/oneOf/src/models/foo.rs index 4b865bfa7dcc..546608178e20 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/foo.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/foo.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref.rs b/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref.rs index fb28017bd08d..bf47bf393c60 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref_or_value.rs b/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref_or_value.rs index 8e0b9e188e10..1e2051ca199c 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref_or_value.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref_or_value.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * @@ -8,19 +10,18 @@ * Generated by: https://openapi-generator.tech */ -use super::Foo; -use super::FooRef; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "@type")] pub enum FooRefOrValue { - Foo(Box), - FooRef(Box), + Foo(Box), + FooRef(Box), } impl Default for FooRefOrValue { fn default() -> Self { + Self::Foo(Box::default()) } } diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs b/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs index d9bc5e23d479..ee9c2ca65a7a 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * @@ -8,8 +10,6 @@ * Generated by: https://openapi-generator.tech */ -use super::Apple; -use super::Banana; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -23,7 +23,8 @@ pub enum Fruit { impl Default for Fruit { fn default() -> Self { - Self::Apple(Box::default()) + Self::Apple(Box::default()) + } } diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/fruit_type.rs b/samples/client/others/rust/reqwest/oneOf/src/models/fruit_type.rs index 3927e1805e1e..b300d992a636 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/fruit_type.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/fruit_type.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/pasta.rs b/samples/client/others/rust/reqwest/oneOf/src/models/pasta.rs index 11f64426bbe0..36652331311b 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/pasta.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/pasta.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/pizza.rs b/samples/client/others/rust/reqwest/oneOf/src/models/pizza.rs index 571ef0a674ee..fcf98581fbd6 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/pizza.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/pizza.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * @@ -14,7 +16,7 @@ #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Pizza { #[serde(rename = "pizzaSize", skip_serializing_if = "Option::is_none")] - pub pizza_size: Option, + pub pizza_size: Option, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] pub href: Option, diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/pizza_speziale.rs b/samples/client/others/rust/reqwest/oneOf/src/models/pizza_speziale.rs index a7ee348297ce..ff82c9a3bc5e 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/pizza_speziale.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/pizza_speziale.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * ByRefOrValue * @@ -16,7 +18,7 @@ pub struct PizzaSpeziale { #[serde(rename = "toppings", skip_serializing_if = "Option::is_none")] pub toppings: Option, #[serde(rename = "pizzaSize", skip_serializing_if = "Option::is_none")] - pub pizza_size: Option, + pub pizza_size: Option, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] pub href: Option, diff --git a/samples/client/petstore/rust/hyper/petstore/docs/ActionContainer.md b/samples/client/petstore/rust/hyper/petstore/docs/ActionContainer.md index 8490ec5d821b..0d690bd0c56f 100644 --- a/samples/client/petstore/rust/hyper/petstore/docs/ActionContainer.md +++ b/samples/client/petstore/rust/hyper/petstore/docs/ActionContainer.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | [**crate::models::Baz**](Baz.md) | | +**action** | [**Baz**](Baz.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/hyper/petstore/docs/ArrayItemRefTest.md b/samples/client/petstore/rust/hyper/petstore/docs/ArrayItemRefTest.md index 57e521d9ce6a..2359c95a1866 100644 --- a/samples/client/petstore/rust/hyper/petstore/docs/ArrayItemRefTest.md +++ b/samples/client/petstore/rust/hyper/petstore/docs/ArrayItemRefTest.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**list_with_array_ref** | [**Vec>**](array.md) | | -**list_with_object_ref** | [**Vec<::std::collections::HashMap>**](map.md) | | +**list_with_array_ref** | [**Vec**](Vec.md) | | +**list_with_object_ref** | [**Vec**](std::collections::HashMap.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/hyper/petstore/docs/Pet.md b/samples/client/petstore/rust/hyper/petstore/docs/Pet.md index 27886889d1d4..e7a72caa16e9 100644 --- a/samples/client/petstore/rust/hyper/petstore/docs/Pet.md +++ b/samples/client/petstore/rust/hyper/petstore/docs/Pet.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | Option<**i64**> | | [optional] -**category** | Option<[**crate::models::Category**](Category.md)> | | [optional] +**category** | Option<[**models::Category**](Category.md)> | | [optional] **name** | **String** | | **photo_urls** | **Vec** | | -**tags** | Option<[**Vec**](Tag.md)> | | [optional] +**tags** | Option<[**Vec**](Tag.md)> | | [optional] **status** | Option<**String**> | pet status in the store | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/hyper/petstore/docs/PetApi.md b/samples/client/petstore/rust/hyper/petstore/docs/PetApi.md index 7deea32cd816..6d542705f058 100644 --- a/samples/client/petstore/rust/hyper/petstore/docs/PetApi.md +++ b/samples/client/petstore/rust/hyper/petstore/docs/PetApi.md @@ -17,7 +17,7 @@ Method | HTTP request | Description ## add_pet -> crate::models::Pet add_pet(pet) +> models::Pet add_pet(pet) Add a new pet to the store @@ -31,7 +31,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Pet**](Pet.md) +[**models::Pet**](Pet.md) ### Authorization @@ -78,7 +78,7 @@ Name | Type | Description | Required | Notes ## find_pets_by_status -> Vec find_pets_by_status(status) +> Vec find_pets_by_status(status) Finds Pets by status Multiple status values can be provided with comma separated strings @@ -92,7 +92,7 @@ Name | Type | Description | Required | Notes ### Return type -[**Vec**](Pet.md) +[**Vec**](Pet.md) ### Authorization @@ -108,7 +108,7 @@ Name | Type | Description | Required | Notes ## find_pets_by_tags -> Vec find_pets_by_tags(tags) +> Vec find_pets_by_tags(tags) Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -122,7 +122,7 @@ Name | Type | Description | Required | Notes ### Return type -[**Vec**](Pet.md) +[**Vec**](Pet.md) ### Authorization @@ -138,7 +138,7 @@ Name | Type | Description | Required | Notes ## get_pet_by_id -> crate::models::Pet get_pet_by_id(pet_id) +> models::Pet get_pet_by_id(pet_id) Find pet by ID Returns a single pet @@ -152,7 +152,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Pet**](Pet.md) +[**models::Pet**](Pet.md) ### Authorization @@ -168,7 +168,7 @@ Name | Type | Description | Required | Notes ## update_pet -> crate::models::Pet update_pet(pet) +> models::Pet update_pet(pet) Update an existing pet @@ -182,7 +182,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Pet**](Pet.md) +[**models::Pet**](Pet.md) ### Authorization @@ -230,7 +230,7 @@ Name | Type | Description | Required | Notes ## upload_file -> crate::models::ApiResponse upload_file(pet_id, additional_metadata, file) +> models::ApiResponse upload_file(pet_id, additional_metadata, file) uploads an image @@ -246,7 +246,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::ApiResponse**](ApiResponse.md) +[**models::ApiResponse**](ApiResponse.md) ### Authorization diff --git a/samples/client/petstore/rust/hyper/petstore/docs/StoreApi.md b/samples/client/petstore/rust/hyper/petstore/docs/StoreApi.md index dbeb0169aa4d..d9bbe8b23734 100644 --- a/samples/client/petstore/rust/hyper/petstore/docs/StoreApi.md +++ b/samples/client/petstore/rust/hyper/petstore/docs/StoreApi.md @@ -43,7 +43,7 @@ No authorization required ## get_inventory -> ::std::collections::HashMap get_inventory() +> std::collections::HashMap get_inventory() Returns pet inventories by status Returns a map of status codes to quantities @@ -54,7 +54,7 @@ This endpoint does not need any parameter. ### Return type -**::std::collections::HashMap** +**std::collections::HashMap** ### Authorization @@ -70,7 +70,7 @@ This endpoint does not need any parameter. ## get_order_by_id -> crate::models::Order get_order_by_id(order_id) +> models::Order get_order_by_id(order_id) Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -84,7 +84,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Order**](Order.md) +[**models::Order**](Order.md) ### Authorization @@ -100,7 +100,7 @@ No authorization required ## place_order -> crate::models::Order place_order(order) +> models::Order place_order(order) Place an order for a pet @@ -114,7 +114,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Order**](Order.md) +[**models::Order**](Order.md) ### Authorization diff --git a/samples/client/petstore/rust/hyper/petstore/docs/TestingApi.md b/samples/client/petstore/rust/hyper/petstore/docs/TestingApi.md index 9f72e78530b4..131b5dda5a8e 100644 --- a/samples/client/petstore/rust/hyper/petstore/docs/TestingApi.md +++ b/samples/client/petstore/rust/hyper/petstore/docs/TestingApi.md @@ -36,7 +36,7 @@ No authorization required ## tests_type_testing_get -> crate::models::TypeTesting tests_type_testing_get() +> models::TypeTesting tests_type_testing_get() Route to test the TypeTesting schema ### Parameters @@ -45,7 +45,7 @@ This endpoint does not need any parameter. ### Return type -[**crate::models::TypeTesting**](TypeTesting.md) +[**models::TypeTesting**](TypeTesting.md) ### Authorization diff --git a/samples/client/petstore/rust/hyper/petstore/docs/UserApi.md b/samples/client/petstore/rust/hyper/petstore/docs/UserApi.md index 39e455d9073d..22192c1fd888 100644 --- a/samples/client/petstore/rust/hyper/petstore/docs/UserApi.md +++ b/samples/client/petstore/rust/hyper/petstore/docs/UserApi.md @@ -57,7 +57,7 @@ Creates list of users with given input array Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**user** | [**Vec**](User.md) | List of user object | [required] | +**user** | [**Vec**](User.md) | List of user object | [required] | ### Return type @@ -87,7 +87,7 @@ Creates list of users with given input array Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**user** | [**Vec**](User.md) | List of user object | [required] | +**user** | [**Vec**](User.md) | List of user object | [required] | ### Return type @@ -137,7 +137,7 @@ Name | Type | Description | Required | Notes ## get_user_by_name -> crate::models::User get_user_by_name(username) +> models::User get_user_by_name(username) Get user by user name @@ -151,7 +151,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::User**](User.md) +[**models::User**](User.md) ### Authorization diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs index 019ed347cdff..edbf3e23bff2 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs @@ -35,20 +35,20 @@ impl PetApiClient } pub trait PetApi { - fn add_pet(&self, pet: crate::models::Pet) -> Pin>>>; + fn add_pet(&self, pet: crate::models::Pet) -> Pin>>>; fn delete_pet(&self, pet_id: i64, api_key: Option<&str>) -> Pin>>>; - fn find_pets_by_status(&self, status: Vec) -> Pin, Error>>>>; - fn find_pets_by_tags(&self, tags: Vec) -> Pin, Error>>>>; - fn get_pet_by_id(&self, pet_id: i64) -> Pin>>>; - fn update_pet(&self, pet: crate::models::Pet) -> Pin>>>; + fn find_pets_by_status(&self, status: Vec) -> Pin, Error>>>>; + fn find_pets_by_tags(&self, tags: Vec) -> Pin, Error>>>>; + fn get_pet_by_id(&self, pet_id: i64) -> Pin>>>; + fn update_pet(&self, pet: crate::models::Pet) -> Pin>>>; fn update_pet_with_form(&self, pet_id: i64, name: Option<&str>, status: Option<&str>) -> Pin>>>; - fn upload_file(&self, pet_id: i64, additional_metadata: Option<&str>, file: Option) -> Pin>>>; + fn upload_file(&self, pet_id: i64, additional_metadata: Option<&str>, file: Option) -> Pin>>>; } implPetApi for PetApiClient where C: Clone + std::marker::Send + Sync { #[allow(unused_mut)] - fn add_pet(&self, pet: crate::models::Pet) -> Pin>>> { + fn add_pet(&self, pet: crate::models::Pet) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::POST, "/pet".to_string()) .with_auth(__internal_request::Auth::Oauth) ; @@ -72,7 +72,7 @@ implPetApi for PetApiClient } #[allow(unused_mut)] - fn find_pets_by_status(&self, status: Vec) -> Pin, Error>>>> { + fn find_pets_by_status(&self, status: Vec) -> Pin, Error>>>> { let mut req = __internal_request::Request::new(hyper::Method::GET, "/pet/findByStatus".to_string()) .with_auth(__internal_request::Auth::Oauth) ; @@ -82,7 +82,7 @@ implPetApi for PetApiClient } #[allow(unused_mut)] - fn find_pets_by_tags(&self, tags: Vec) -> Pin, Error>>>> { + fn find_pets_by_tags(&self, tags: Vec) -> Pin, Error>>>> { let mut req = __internal_request::Request::new(hyper::Method::GET, "/pet/findByTags".to_string()) .with_auth(__internal_request::Auth::Oauth) ; @@ -92,7 +92,7 @@ implPetApi for PetApiClient } #[allow(unused_mut)] - fn get_pet_by_id(&self, pet_id: i64) -> Pin>>> { + fn get_pet_by_id(&self, pet_id: i64) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::GET, "/pet/{petId}".to_string()) .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ in_header: true, @@ -106,7 +106,7 @@ implPetApi for PetApiClient } #[allow(unused_mut)] - fn update_pet(&self, pet: crate::models::Pet) -> Pin>>> { + fn update_pet(&self, pet: crate::models::Pet) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::PUT, "/pet".to_string()) .with_auth(__internal_request::Auth::Oauth) ; @@ -133,7 +133,7 @@ implPetApi for PetApiClient } #[allow(unused_mut)] - fn upload_file(&self, pet_id: i64, additional_metadata: Option<&str>, file: Option) -> Pin>>> { + fn upload_file(&self, pet_id: i64, additional_metadata: Option<&str>, file: Option) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::POST, "/pet/{petId}/uploadImage".to_string()) .with_auth(__internal_request::Auth::Oauth) ; diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs index e4bb56308283..6038b8e51325 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs @@ -36,9 +36,9 @@ impl StoreApiClient pub trait StoreApi { fn delete_order(&self, order_id: &str) -> Pin>>>; - fn get_inventory(&self, ) -> Pin, Error>>>>; - fn get_order_by_id(&self, order_id: i64) -> Pin>>>; - fn place_order(&self, order: crate::models::Order) -> Pin>>>; + fn get_inventory(&self, ) -> Pin, Error>>>>; + fn get_order_by_id(&self, order_id: i64) -> Pin>>>; + fn place_order(&self, order: crate::models::Order) -> Pin>>>; } implStoreApi for StoreApiClient @@ -54,7 +54,7 @@ implStoreApi for StoreApiClient } #[allow(unused_mut)] - fn get_inventory(&self, ) -> Pin, Error>>>> { + fn get_inventory(&self, ) -> Pin, Error>>>> { let mut req = __internal_request::Request::new(hyper::Method::GET, "/store/inventory".to_string()) .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ in_header: true, @@ -67,7 +67,7 @@ implStoreApi for StoreApiClient } #[allow(unused_mut)] - fn get_order_by_id(&self, order_id: i64) -> Pin>>> { + fn get_order_by_id(&self, order_id: i64) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::GET, "/store/order/{orderId}".to_string()) ; req = req.with_path_param("orderId".to_string(), order_id.to_string()); @@ -76,7 +76,7 @@ implStoreApi for StoreApiClient } #[allow(unused_mut)] - fn place_order(&self, order: crate::models::Order) -> Pin>>> { + fn place_order(&self, order: crate::models::Order) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::POST, "/store/order".to_string()) ; req = req.with_body_param(order); diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/testing_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/testing_api.rs index fd521555b763..60ab9102fef4 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/testing_api.rs @@ -36,7 +36,7 @@ impl TestingApiClient pub trait TestingApi { fn tests_file_response_get(&self, ) -> Pin>>>; - fn tests_type_testing_get(&self, ) -> Pin>>>; + fn tests_type_testing_get(&self, ) -> Pin>>>; } implTestingApi for TestingApiClient @@ -50,7 +50,7 @@ implTestingApi for TestingApiClient } #[allow(unused_mut)] - fn tests_type_testing_get(&self, ) -> Pin>>> { + fn tests_type_testing_get(&self, ) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::GET, "/tests/typeTesting".to_string()) ; diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs index 817d9166a8b5..dc14ad51bf58 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs @@ -36,10 +36,10 @@ impl UserApiClient pub trait UserApi { fn create_user(&self, user: crate::models::User) -> Pin>>>; - fn create_users_with_array_input(&self, user: Vec) -> Pin>>>; - fn create_users_with_list_input(&self, user: Vec) -> Pin>>>; + fn create_users_with_array_input(&self, user: Vec) -> Pin>>>; + fn create_users_with_list_input(&self, user: Vec) -> Pin>>>; fn delete_user(&self, username: &str) -> Pin>>>; - fn get_user_by_name(&self, username: &str) -> Pin>>>; + fn get_user_by_name(&self, username: &str) -> Pin>>>; fn login_user(&self, username: &str, password: &str) -> Pin>>>; fn logout_user(&self, ) -> Pin>>>; fn update_user(&self, username: &str, user: crate::models::User) -> Pin>>>; @@ -63,7 +63,7 @@ implUserApi for UserApiClient } #[allow(unused_mut)] - fn create_users_with_array_input(&self, user: Vec) -> Pin>>> { + fn create_users_with_array_input(&self, user: Vec) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::POST, "/user/createWithArray".to_string()) .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ in_header: true, @@ -78,7 +78,7 @@ implUserApi for UserApiClient } #[allow(unused_mut)] - fn create_users_with_list_input(&self, user: Vec) -> Pin>>> { + fn create_users_with_list_input(&self, user: Vec) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::POST, "/user/createWithList".to_string()) .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ in_header: true, @@ -108,7 +108,7 @@ implUserApi for UserApiClient } #[allow(unused_mut)] - fn get_user_by_name(&self, username: &str) -> Pin>>> { + fn get_user_by_name(&self, username: &str) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::GET, "/user/{username}".to_string()) ; req = req.with_path_param("username".to_string(), username.to_string()); diff --git a/samples/client/petstore/rust/hyper/petstore/src/lib.rs b/samples/client/petstore/rust/hyper/petstore/src/lib.rs index a76d822525da..b49043ca0402 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/lib.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/lib.rs @@ -1,3 +1,5 @@ +#![allow(unused_imports)] + #[macro_use] extern crate serde_derive; diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/action_container.rs b/samples/client/petstore/rust/hyper/petstore/src/models/action_container.rs index 7e2d9a0717f9..20fcdf51c3fa 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/action_container.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/action_container.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * @@ -14,11 +16,11 @@ #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ActionContainer { #[serde(rename = "action")] - pub action: Box, + pub action: Box, } impl ActionContainer { - pub fn new(action: crate::models::Baz) -> ActionContainer { + pub fn new(action: Baz) -> ActionContainer { ActionContainer { action: Box::new(action), } diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/api_response.rs b/samples/client/petstore/rust/hyper/petstore/src/models/api_response.rs index 1741c9ff9cdd..001383c97f18 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/api_response.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/api_response.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/array_item_ref_test.rs b/samples/client/petstore/rust/hyper/petstore/src/models/array_item_ref_test.rs index 09e7611f0ef4..1a7d5f38a0b5 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/array_item_ref_test.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/array_item_ref_test.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * @@ -15,14 +17,14 @@ #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ArrayItemRefTest { #[serde(rename = "list_with_array_ref")] - pub list_with_array_ref: Vec>, + pub list_with_array_ref: Vec, #[serde(rename = "list_with_object_ref")] - pub list_with_object_ref: Vec<::std::collections::HashMap>, + pub list_with_object_ref: Vec, } impl ArrayItemRefTest { /// Test handling of object reference in arrays - pub fn new(list_with_array_ref: Vec>, list_with_object_ref: Vec<::std::collections::HashMap>) -> ArrayItemRefTest { + pub fn new(list_with_array_ref: Vec, list_with_object_ref: Vec) -> ArrayItemRefTest { ArrayItemRefTest { list_with_array_ref, list_with_object_ref, diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/baz.rs b/samples/client/petstore/rust/hyper/petstore/src/models/baz.rs index 94f8c5aa6aa4..e572fe204124 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/baz.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/baz.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/category.rs b/samples/client/petstore/rust/hyper/petstore/src/models/category.rs index e62af6878b9e..067aad5e54fd 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/category.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/category.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/enum_array_testing.rs b/samples/client/petstore/rust/hyper/petstore/src/models/enum_array_testing.rs index 4ad77233833a..860f9d02dcf1 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/enum_array_testing.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/enum_array_testing.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/model_return.rs b/samples/client/petstore/rust/hyper/petstore/src/models/model_return.rs index d9619444f707..45f12f85fec1 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/model_return.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/model_return.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/nullable_array.rs b/samples/client/petstore/rust/hyper/petstore/src/models/nullable_array.rs index f177f16192c5..aad44660b5dc 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/nullable_array.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/nullable_array.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/optional_testing.rs b/samples/client/petstore/rust/hyper/petstore/src/models/optional_testing.rs index e8f7af5c012e..9f24111bd076 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/optional_testing.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/optional_testing.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/order.rs b/samples/client/petstore/rust/hyper/petstore/src/models/order.rs index e3385c8ff03c..3e916b84b379 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/order.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/order.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/pet.rs b/samples/client/petstore/rust/hyper/petstore/src/models/pet.rs index 6661e036994b..6097058b792e 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/pet.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/pet.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * @@ -17,13 +19,13 @@ pub struct Pet { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, #[serde(rename = "category", skip_serializing_if = "Option::is_none")] - pub category: Option>, + pub category: Option>, #[serde(rename = "name")] pub name: String, #[serde(rename = "photoUrls")] pub photo_urls: Vec, #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] - pub tags: Option>, + pub tags: Option>, /// pet status in the store #[serde(rename = "status", skip_serializing_if = "Option::is_none")] pub status: Option, diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/property_test.rs b/samples/client/petstore/rust/hyper/petstore/src/models/property_test.rs index e496a02311c4..330649729037 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/property_test.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/property_test.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/tag.rs b/samples/client/petstore/rust/hyper/petstore/src/models/tag.rs index 1786ebec3ac2..d21f0aafd8e6 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/tag.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/tag.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/type_testing.rs b/samples/client/petstore/rust/hyper/petstore/src/models/type_testing.rs index 079ac75daff8..4f0a1819194b 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/type_testing.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/type_testing.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/unique_item_array_testing.rs b/samples/client/petstore/rust/hyper/petstore/src/models/unique_item_array_testing.rs index 854ca0916ae1..93efbd1aa241 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/unique_item_array_testing.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/unique_item_array_testing.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/user.rs b/samples/client/petstore/rust/hyper/petstore/src/models/user.rs index c52c16ba3162..f8153db61739 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/user.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/user.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/name-mapping/src/lib.rs b/samples/client/petstore/rust/reqwest/name-mapping/src/lib.rs index c1dd666f7957..1ac114198fdd 100644 --- a/samples/client/petstore/rust/reqwest/name-mapping/src/lib.rs +++ b/samples/client/petstore/rust/reqwest/name-mapping/src/lib.rs @@ -1,3 +1,5 @@ +#![allow(unused_imports)] + #[macro_use] extern crate serde_derive; diff --git a/samples/client/petstore/rust/reqwest/name-mapping/src/models/property_name_mapping.rs b/samples/client/petstore/rust/reqwest/name-mapping/src/models/property_name_mapping.rs index 713d6680fe9a..a61c9d7cc079 100644 --- a/samples/client/petstore/rust/reqwest/name-mapping/src/models/property_name_mapping.rs +++ b/samples/client/petstore/rust/reqwest/name-mapping/src/models/property_name_mapping.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * rust test * diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/ActionContainer.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/ActionContainer.md index 8490ec5d821b..0d690bd0c56f 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/ActionContainer.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/ActionContainer.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | [**crate::models::Baz**](Baz.md) | | +**action** | [**Baz**](Baz.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/ArrayItemRefTest.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/ArrayItemRefTest.md index 57e521d9ce6a..2359c95a1866 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/ArrayItemRefTest.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/ArrayItemRefTest.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**list_with_array_ref** | [**Vec>**](array.md) | | -**list_with_object_ref** | [**Vec<::std::collections::HashMap>**](map.md) | | +**list_with_array_ref** | [**Vec**](Vec.md) | | +**list_with_object_ref** | [**Vec**](std::collections::HashMap.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/Pet.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/Pet.md index 27886889d1d4..e7a72caa16e9 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/Pet.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/Pet.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | Option<**i64**> | | [optional] -**category** | Option<[**crate::models::Category**](Category.md)> | | [optional] +**category** | Option<[**models::Category**](Category.md)> | | [optional] **name** | **String** | | **photo_urls** | **Vec** | | -**tags** | Option<[**Vec**](Tag.md)> | | [optional] +**tags** | Option<[**Vec**](Tag.md)> | | [optional] **status** | Option<**String**> | pet status in the store | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/PetApi.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/PetApi.md index 5adc9334151a..d503facb903c 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/PetApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/PetApi.md @@ -17,7 +17,7 @@ Method | HTTP request | Description ## add_pet -> crate::models::Pet add_pet(pet) +> models::Pet add_pet(pet) Add a new pet to the store @@ -31,7 +31,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Pet**](Pet.md) +[**models::Pet**](Pet.md) ### Authorization @@ -78,7 +78,7 @@ Name | Type | Description | Required | Notes ## find_pets_by_status -> Vec find_pets_by_status(status) +> Vec find_pets_by_status(status) Finds Pets by status Multiple status values can be provided with comma separated strings @@ -92,7 +92,7 @@ Name | Type | Description | Required | Notes ### Return type -[**Vec**](Pet.md) +[**Vec**](Pet.md) ### Authorization @@ -108,7 +108,7 @@ Name | Type | Description | Required | Notes ## find_pets_by_tags -> Vec find_pets_by_tags(tags) +> Vec find_pets_by_tags(tags) Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -122,7 +122,7 @@ Name | Type | Description | Required | Notes ### Return type -[**Vec**](Pet.md) +[**Vec**](Pet.md) ### Authorization @@ -138,7 +138,7 @@ Name | Type | Description | Required | Notes ## get_pet_by_id -> crate::models::Pet get_pet_by_id(pet_id) +> models::Pet get_pet_by_id(pet_id) Find pet by ID Returns a single pet @@ -152,7 +152,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Pet**](Pet.md) +[**models::Pet**](Pet.md) ### Authorization @@ -168,7 +168,7 @@ Name | Type | Description | Required | Notes ## update_pet -> crate::models::Pet update_pet(pet) +> models::Pet update_pet(pet) Update an existing pet @@ -182,7 +182,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Pet**](Pet.md) +[**models::Pet**](Pet.md) ### Authorization @@ -230,7 +230,7 @@ Name | Type | Description | Required | Notes ## upload_file -> crate::models::ApiResponse upload_file(pet_id, additional_metadata, file) +> models::ApiResponse upload_file(pet_id, additional_metadata, file) uploads an image @@ -246,7 +246,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::ApiResponse**](ApiResponse.md) +[**models::ApiResponse**](ApiResponse.md) ### Authorization diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/StoreApi.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/StoreApi.md index 5796357f53ba..a513dfa1b5fa 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/StoreApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/StoreApi.md @@ -43,7 +43,7 @@ No authorization required ## get_inventory -> ::std::collections::HashMap get_inventory() +> std::collections::HashMap get_inventory() Returns pet inventories by status Returns a map of status codes to quantities @@ -54,7 +54,7 @@ This endpoint does not need any parameter. ### Return type -**::std::collections::HashMap** +**std::collections::HashMap** ### Authorization @@ -70,7 +70,7 @@ This endpoint does not need any parameter. ## get_order_by_id -> crate::models::Order get_order_by_id(order_id) +> models::Order get_order_by_id(order_id) Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -84,7 +84,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Order**](Order.md) +[**models::Order**](Order.md) ### Authorization @@ -100,7 +100,7 @@ No authorization required ## place_order -> crate::models::Order place_order(order) +> models::Order place_order(order) Place an order for a pet @@ -114,7 +114,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Order**](Order.md) +[**models::Order**](Order.md) ### Authorization diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/TestingApi.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/TestingApi.md index ca0c06e06a05..9c26af249127 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/TestingApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/TestingApi.md @@ -36,7 +36,7 @@ No authorization required ## tests_type_testing_get -> crate::models::TypeTesting tests_type_testing_get() +> models::TypeTesting tests_type_testing_get() Route to test the TypeTesting schema ### Parameters @@ -45,7 +45,7 @@ This endpoint does not need any parameter. ### Return type -[**crate::models::TypeTesting**](TypeTesting.md) +[**models::TypeTesting**](TypeTesting.md) ### Authorization diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/UserApi.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/UserApi.md index 03693014b925..d536057ae15a 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/UserApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/UserApi.md @@ -57,7 +57,7 @@ Creates list of users with given input array Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**user** | [**Vec**](User.md) | List of user object | [required] | +**user** | [**Vec**](User.md) | List of user object | [required] | ### Return type @@ -87,7 +87,7 @@ Creates list of users with given input array Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**user** | [**Vec**](User.md) | List of user object | [required] | +**user** | [**Vec**](User.md) | List of user object | [required] | ### Return type @@ -137,7 +137,7 @@ Name | Type | Description | Required | Notes ## get_user_by_name -> crate::models::User get_user_by_name(username) +> models::User get_user_by_name(username) Get user by user name @@ -151,7 +151,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::User**](User.md) +[**models::User**](User.md) ### Authorization diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/pet_api.rs index e43940a7ea15..2e56c86ce25c 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/pet_api.rs @@ -84,7 +84,7 @@ pub struct UploadFileParams { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum AddPetSuccess { - Status200(crate::models::Pet), + Status200(models::Pet), UnknownValue(serde_json::Value), } @@ -99,7 +99,7 @@ pub enum DeletePetSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum FindPetsByStatusSuccess { - Status200(Vec), + Status200(Vec), UnknownValue(serde_json::Value), } @@ -107,7 +107,7 @@ pub enum FindPetsByStatusSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum FindPetsByTagsSuccess { - Status200(Vec), + Status200(Vec), UnknownValue(serde_json::Value), } @@ -115,7 +115,7 @@ pub enum FindPetsByTagsSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum GetPetByIdSuccess { - Status200(crate::models::Pet), + Status200(models::Pet), UnknownValue(serde_json::Value), } @@ -123,7 +123,7 @@ pub enum GetPetByIdSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum UpdatePetSuccess { - Status200(crate::models::Pet), + Status200(models::Pet), UnknownValue(serde_json::Value), } @@ -138,7 +138,7 @@ pub enum UpdatePetWithFormSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum UploadFileSuccess { - Status200(crate::models::ApiResponse), + Status200(models::ApiResponse), UnknownValue(serde_json::Value), } diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/store_api.rs index e73715616991..43b6a5f39ed8 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/store_api.rs @@ -47,7 +47,7 @@ pub enum DeleteOrderSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum GetInventorySuccess { - Status200(::std::collections::HashMap), + Status200(std::collections::HashMap), UnknownValue(serde_json::Value), } @@ -55,7 +55,7 @@ pub enum GetInventorySuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum GetOrderByIdSuccess { - Status200(crate::models::Order), + Status200(models::Order), UnknownValue(serde_json::Value), } @@ -63,7 +63,7 @@ pub enum GetOrderByIdSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum PlaceOrderSuccess { - Status200(crate::models::Order), + Status200(models::Order), UnknownValue(serde_json::Value), } diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/testing_api.rs index 98f2fa156259..cf422b2eba37 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/testing_api.rs @@ -27,7 +27,7 @@ pub enum TestsFileResponseGetSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum TestsTypeTestingGetSuccess { - Status200(crate::models::TypeTesting), + Status200(models::TypeTesting), UnknownValue(serde_json::Value), } diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/user_api.rs index c9409596afdb..1d56ae6d3f26 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/user_api.rs @@ -25,14 +25,14 @@ pub struct CreateUserParams { #[derive(Clone, Debug)] pub struct CreateUsersWithArrayInputParams { /// List of user object - pub user: Vec + pub user: Vec } /// struct for passing parameters to the method [`create_users_with_list_input`] #[derive(Clone, Debug)] pub struct CreateUsersWithListInputParams { /// List of user object - pub user: Vec + pub user: Vec } /// struct for passing parameters to the method [`delete_user`] @@ -100,7 +100,7 @@ pub enum DeleteUserSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum GetUserByNameSuccess { - Status200(crate::models::User), + Status200(models::User), UnknownValue(serde_json::Value), } diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/lib.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/lib.rs index c1dd666f7957..1ac114198fdd 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/lib.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/lib.rs @@ -1,3 +1,5 @@ +#![allow(unused_imports)] + #[macro_use] extern crate serde_derive; diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/action_container.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/action_container.rs index 7e2d9a0717f9..20fcdf51c3fa 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/action_container.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/action_container.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * @@ -14,11 +16,11 @@ #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ActionContainer { #[serde(rename = "action")] - pub action: Box, + pub action: Box, } impl ActionContainer { - pub fn new(action: crate::models::Baz) -> ActionContainer { + pub fn new(action: Baz) -> ActionContainer { ActionContainer { action: Box::new(action), } diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/api_response.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/api_response.rs index 1741c9ff9cdd..001383c97f18 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/api_response.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/api_response.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/array_item_ref_test.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/array_item_ref_test.rs index 09e7611f0ef4..1a7d5f38a0b5 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/array_item_ref_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/array_item_ref_test.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * @@ -15,14 +17,14 @@ #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ArrayItemRefTest { #[serde(rename = "list_with_array_ref")] - pub list_with_array_ref: Vec>, + pub list_with_array_ref: Vec, #[serde(rename = "list_with_object_ref")] - pub list_with_object_ref: Vec<::std::collections::HashMap>, + pub list_with_object_ref: Vec, } impl ArrayItemRefTest { /// Test handling of object reference in arrays - pub fn new(list_with_array_ref: Vec>, list_with_object_ref: Vec<::std::collections::HashMap>) -> ArrayItemRefTest { + pub fn new(list_with_array_ref: Vec, list_with_object_ref: Vec) -> ArrayItemRefTest { ArrayItemRefTest { list_with_array_ref, list_with_object_ref, diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/baz.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/baz.rs index 94f8c5aa6aa4..e572fe204124 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/baz.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/baz.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/category.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/category.rs index e62af6878b9e..067aad5e54fd 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/category.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/category.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/enum_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/enum_array_testing.rs index 4ad77233833a..860f9d02dcf1 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/enum_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/enum_array_testing.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/model_return.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/model_return.rs index d9619444f707..45f12f85fec1 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/model_return.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/model_return.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/nullable_array.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/nullable_array.rs index f177f16192c5..aad44660b5dc 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/nullable_array.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/nullable_array.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/optional_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/optional_testing.rs index e8f7af5c012e..9f24111bd076 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/optional_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/optional_testing.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/order.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/order.rs index e3385c8ff03c..3e916b84b379 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/order.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/order.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/pet.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/pet.rs index 6661e036994b..6097058b792e 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/pet.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/pet.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * @@ -17,13 +19,13 @@ pub struct Pet { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, #[serde(rename = "category", skip_serializing_if = "Option::is_none")] - pub category: Option>, + pub category: Option>, #[serde(rename = "name")] pub name: String, #[serde(rename = "photoUrls")] pub photo_urls: Vec, #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] - pub tags: Option>, + pub tags: Option>, /// pet status in the store #[serde(rename = "status", skip_serializing_if = "Option::is_none")] pub status: Option, diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/property_test.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/property_test.rs index e496a02311c4..330649729037 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/property_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/property_test.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/tag.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/tag.rs index 1786ebec3ac2..d21f0aafd8e6 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/tag.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/tag.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/type_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/type_testing.rs index 079ac75daff8..4f0a1819194b 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/type_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/type_testing.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/unique_item_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/unique_item_array_testing.rs index 854ca0916ae1..93efbd1aa241 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/unique_item_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/unique_item_array_testing.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/user.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/user.rs index c52c16ba3162..f8153db61739 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/user.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/user.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/ActionContainer.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/ActionContainer.md index 8490ec5d821b..0d690bd0c56f 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/ActionContainer.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/ActionContainer.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | [**crate::models::Baz**](Baz.md) | | +**action** | [**Baz**](Baz.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/ArrayItemRefTest.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/ArrayItemRefTest.md index 57e521d9ce6a..2359c95a1866 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/ArrayItemRefTest.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/ArrayItemRefTest.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**list_with_array_ref** | [**Vec>**](array.md) | | -**list_with_object_ref** | [**Vec<::std::collections::HashMap>**](map.md) | | +**list_with_array_ref** | [**Vec**](Vec.md) | | +**list_with_object_ref** | [**Vec**](std::collections::HashMap.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/Pet.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/Pet.md index 27886889d1d4..e7a72caa16e9 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/Pet.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/Pet.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | Option<**i64**> | | [optional] -**category** | Option<[**crate::models::Category**](Category.md)> | | [optional] +**category** | Option<[**models::Category**](Category.md)> | | [optional] **name** | **String** | | **photo_urls** | **Vec** | | -**tags** | Option<[**Vec**](Tag.md)> | | [optional] +**tags** | Option<[**Vec**](Tag.md)> | | [optional] **status** | Option<**String**> | pet status in the store | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/PetApi.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/PetApi.md index 5adc9334151a..d503facb903c 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/PetApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/PetApi.md @@ -17,7 +17,7 @@ Method | HTTP request | Description ## add_pet -> crate::models::Pet add_pet(pet) +> models::Pet add_pet(pet) Add a new pet to the store @@ -31,7 +31,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Pet**](Pet.md) +[**models::Pet**](Pet.md) ### Authorization @@ -78,7 +78,7 @@ Name | Type | Description | Required | Notes ## find_pets_by_status -> Vec find_pets_by_status(status) +> Vec find_pets_by_status(status) Finds Pets by status Multiple status values can be provided with comma separated strings @@ -92,7 +92,7 @@ Name | Type | Description | Required | Notes ### Return type -[**Vec**](Pet.md) +[**Vec**](Pet.md) ### Authorization @@ -108,7 +108,7 @@ Name | Type | Description | Required | Notes ## find_pets_by_tags -> Vec find_pets_by_tags(tags) +> Vec find_pets_by_tags(tags) Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -122,7 +122,7 @@ Name | Type | Description | Required | Notes ### Return type -[**Vec**](Pet.md) +[**Vec**](Pet.md) ### Authorization @@ -138,7 +138,7 @@ Name | Type | Description | Required | Notes ## get_pet_by_id -> crate::models::Pet get_pet_by_id(pet_id) +> models::Pet get_pet_by_id(pet_id) Find pet by ID Returns a single pet @@ -152,7 +152,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Pet**](Pet.md) +[**models::Pet**](Pet.md) ### Authorization @@ -168,7 +168,7 @@ Name | Type | Description | Required | Notes ## update_pet -> crate::models::Pet update_pet(pet) +> models::Pet update_pet(pet) Update an existing pet @@ -182,7 +182,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Pet**](Pet.md) +[**models::Pet**](Pet.md) ### Authorization @@ -230,7 +230,7 @@ Name | Type | Description | Required | Notes ## upload_file -> crate::models::ApiResponse upload_file(pet_id, additional_metadata, file) +> models::ApiResponse upload_file(pet_id, additional_metadata, file) uploads an image @@ -246,7 +246,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::ApiResponse**](ApiResponse.md) +[**models::ApiResponse**](ApiResponse.md) ### Authorization diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/StoreApi.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/StoreApi.md index 5796357f53ba..a513dfa1b5fa 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/StoreApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/StoreApi.md @@ -43,7 +43,7 @@ No authorization required ## get_inventory -> ::std::collections::HashMap get_inventory() +> std::collections::HashMap get_inventory() Returns pet inventories by status Returns a map of status codes to quantities @@ -54,7 +54,7 @@ This endpoint does not need any parameter. ### Return type -**::std::collections::HashMap** +**std::collections::HashMap** ### Authorization @@ -70,7 +70,7 @@ This endpoint does not need any parameter. ## get_order_by_id -> crate::models::Order get_order_by_id(order_id) +> models::Order get_order_by_id(order_id) Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -84,7 +84,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Order**](Order.md) +[**models::Order**](Order.md) ### Authorization @@ -100,7 +100,7 @@ No authorization required ## place_order -> crate::models::Order place_order(order) +> models::Order place_order(order) Place an order for a pet @@ -114,7 +114,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Order**](Order.md) +[**models::Order**](Order.md) ### Authorization diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/TestingApi.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/TestingApi.md index ca0c06e06a05..9c26af249127 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/TestingApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/TestingApi.md @@ -36,7 +36,7 @@ No authorization required ## tests_type_testing_get -> crate::models::TypeTesting tests_type_testing_get() +> models::TypeTesting tests_type_testing_get() Route to test the TypeTesting schema ### Parameters @@ -45,7 +45,7 @@ This endpoint does not need any parameter. ### Return type -[**crate::models::TypeTesting**](TypeTesting.md) +[**models::TypeTesting**](TypeTesting.md) ### Authorization diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/UserApi.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/UserApi.md index 03693014b925..d536057ae15a 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/UserApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/UserApi.md @@ -57,7 +57,7 @@ Creates list of users with given input array Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**user** | [**Vec**](User.md) | List of user object | [required] | +**user** | [**Vec**](User.md) | List of user object | [required] | ### Return type @@ -87,7 +87,7 @@ Creates list of users with given input array Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**user** | [**Vec**](User.md) | List of user object | [required] | +**user** | [**Vec**](User.md) | List of user object | [required] | ### Return type @@ -137,7 +137,7 @@ Name | Type | Description | Required | Notes ## get_user_by_name -> crate::models::User get_user_by_name(username) +> models::User get_user_by_name(username) Get user by user name @@ -151,7 +151,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::User**](User.md) +[**models::User**](User.md) ### Authorization diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs index e43940a7ea15..2e56c86ce25c 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs @@ -84,7 +84,7 @@ pub struct UploadFileParams { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum AddPetSuccess { - Status200(crate::models::Pet), + Status200(models::Pet), UnknownValue(serde_json::Value), } @@ -99,7 +99,7 @@ pub enum DeletePetSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum FindPetsByStatusSuccess { - Status200(Vec), + Status200(Vec), UnknownValue(serde_json::Value), } @@ -107,7 +107,7 @@ pub enum FindPetsByStatusSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum FindPetsByTagsSuccess { - Status200(Vec), + Status200(Vec), UnknownValue(serde_json::Value), } @@ -115,7 +115,7 @@ pub enum FindPetsByTagsSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum GetPetByIdSuccess { - Status200(crate::models::Pet), + Status200(models::Pet), UnknownValue(serde_json::Value), } @@ -123,7 +123,7 @@ pub enum GetPetByIdSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum UpdatePetSuccess { - Status200(crate::models::Pet), + Status200(models::Pet), UnknownValue(serde_json::Value), } @@ -138,7 +138,7 @@ pub enum UpdatePetWithFormSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum UploadFileSuccess { - Status200(crate::models::ApiResponse), + Status200(models::ApiResponse), UnknownValue(serde_json::Value), } diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs index e73715616991..43b6a5f39ed8 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs @@ -47,7 +47,7 @@ pub enum DeleteOrderSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum GetInventorySuccess { - Status200(::std::collections::HashMap), + Status200(std::collections::HashMap), UnknownValue(serde_json::Value), } @@ -55,7 +55,7 @@ pub enum GetInventorySuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum GetOrderByIdSuccess { - Status200(crate::models::Order), + Status200(models::Order), UnknownValue(serde_json::Value), } @@ -63,7 +63,7 @@ pub enum GetOrderByIdSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum PlaceOrderSuccess { - Status200(crate::models::Order), + Status200(models::Order), UnknownValue(serde_json::Value), } diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/testing_api.rs index 98f2fa156259..cf422b2eba37 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/testing_api.rs @@ -27,7 +27,7 @@ pub enum TestsFileResponseGetSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum TestsTypeTestingGetSuccess { - Status200(crate::models::TypeTesting), + Status200(models::TypeTesting), UnknownValue(serde_json::Value), } diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs index c9409596afdb..1d56ae6d3f26 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs @@ -25,14 +25,14 @@ pub struct CreateUserParams { #[derive(Clone, Debug)] pub struct CreateUsersWithArrayInputParams { /// List of user object - pub user: Vec + pub user: Vec } /// struct for passing parameters to the method [`create_users_with_list_input`] #[derive(Clone, Debug)] pub struct CreateUsersWithListInputParams { /// List of user object - pub user: Vec + pub user: Vec } /// struct for passing parameters to the method [`delete_user`] @@ -100,7 +100,7 @@ pub enum DeleteUserSuccess { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum GetUserByNameSuccess { - Status200(crate::models::User), + Status200(models::User), UnknownValue(serde_json::Value), } diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/lib.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/lib.rs index c1dd666f7957..1ac114198fdd 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/lib.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/lib.rs @@ -1,3 +1,5 @@ +#![allow(unused_imports)] + #[macro_use] extern crate serde_derive; diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/action_container.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/action_container.rs index 7e2d9a0717f9..20fcdf51c3fa 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/action_container.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/action_container.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * @@ -14,11 +16,11 @@ #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ActionContainer { #[serde(rename = "action")] - pub action: Box, + pub action: Box, } impl ActionContainer { - pub fn new(action: crate::models::Baz) -> ActionContainer { + pub fn new(action: Baz) -> ActionContainer { ActionContainer { action: Box::new(action), } diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/api_response.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/api_response.rs index 1741c9ff9cdd..001383c97f18 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/api_response.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/api_response.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/array_item_ref_test.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/array_item_ref_test.rs index 09e7611f0ef4..1a7d5f38a0b5 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/array_item_ref_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/array_item_ref_test.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * @@ -15,14 +17,14 @@ #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ArrayItemRefTest { #[serde(rename = "list_with_array_ref")] - pub list_with_array_ref: Vec>, + pub list_with_array_ref: Vec, #[serde(rename = "list_with_object_ref")] - pub list_with_object_ref: Vec<::std::collections::HashMap>, + pub list_with_object_ref: Vec, } impl ArrayItemRefTest { /// Test handling of object reference in arrays - pub fn new(list_with_array_ref: Vec>, list_with_object_ref: Vec<::std::collections::HashMap>) -> ArrayItemRefTest { + pub fn new(list_with_array_ref: Vec, list_with_object_ref: Vec) -> ArrayItemRefTest { ArrayItemRefTest { list_with_array_ref, list_with_object_ref, diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/baz.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/baz.rs index 94f8c5aa6aa4..e572fe204124 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/baz.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/baz.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/category.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/category.rs index e62af6878b9e..067aad5e54fd 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/category.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/category.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/enum_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/enum_array_testing.rs index 4ad77233833a..860f9d02dcf1 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/enum_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/enum_array_testing.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/model_return.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/model_return.rs index d9619444f707..45f12f85fec1 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/model_return.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/model_return.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/nullable_array.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/nullable_array.rs index f177f16192c5..aad44660b5dc 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/nullable_array.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/nullable_array.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/optional_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/optional_testing.rs index e8f7af5c012e..9f24111bd076 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/optional_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/optional_testing.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/order.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/order.rs index e3385c8ff03c..3e916b84b379 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/order.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/order.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/pet.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/pet.rs index 6661e036994b..6097058b792e 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/pet.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/pet.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * @@ -17,13 +19,13 @@ pub struct Pet { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, #[serde(rename = "category", skip_serializing_if = "Option::is_none")] - pub category: Option>, + pub category: Option>, #[serde(rename = "name")] pub name: String, #[serde(rename = "photoUrls")] pub photo_urls: Vec, #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] - pub tags: Option>, + pub tags: Option>, /// pet status in the store #[serde(rename = "status", skip_serializing_if = "Option::is_none")] pub status: Option, diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/property_test.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/property_test.rs index e496a02311c4..330649729037 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/property_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/property_test.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/tag.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/tag.rs index 1786ebec3ac2..d21f0aafd8e6 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/tag.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/tag.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/type_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/type_testing.rs index 079ac75daff8..4f0a1819194b 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/type_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/type_testing.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/unique_item_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/unique_item_array_testing.rs index 854ca0916ae1..93efbd1aa241 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/unique_item_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/unique_item_array_testing.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/user.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/user.rs index c52c16ba3162..f8153db61739 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/user.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/user.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/ActionContainer.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/ActionContainer.md index 8490ec5d821b..0d690bd0c56f 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/ActionContainer.md +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/ActionContainer.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | [**crate::models::Baz**](Baz.md) | | +**action** | [**Baz**](Baz.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/ArrayItemRefTest.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/ArrayItemRefTest.md index 57e521d9ce6a..2359c95a1866 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/ArrayItemRefTest.md +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/ArrayItemRefTest.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**list_with_array_ref** | [**Vec>**](array.md) | | -**list_with_object_ref** | [**Vec<::std::collections::HashMap>**](map.md) | | +**list_with_array_ref** | [**Vec**](Vec.md) | | +**list_with_object_ref** | [**Vec**](std::collections::HashMap.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/Pet.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/Pet.md index 27886889d1d4..e7a72caa16e9 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/Pet.md +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/Pet.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | Option<**i64**> | | [optional] -**category** | Option<[**crate::models::Category**](Category.md)> | | [optional] +**category** | Option<[**models::Category**](Category.md)> | | [optional] **name** | **String** | | **photo_urls** | **Vec** | | -**tags** | Option<[**Vec**](Tag.md)> | | [optional] +**tags** | Option<[**Vec**](Tag.md)> | | [optional] **status** | Option<**String**> | pet status in the store | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/PetApi.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/PetApi.md index 5adc9334151a..d503facb903c 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/PetApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/PetApi.md @@ -17,7 +17,7 @@ Method | HTTP request | Description ## add_pet -> crate::models::Pet add_pet(pet) +> models::Pet add_pet(pet) Add a new pet to the store @@ -31,7 +31,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Pet**](Pet.md) +[**models::Pet**](Pet.md) ### Authorization @@ -78,7 +78,7 @@ Name | Type | Description | Required | Notes ## find_pets_by_status -> Vec find_pets_by_status(status) +> Vec find_pets_by_status(status) Finds Pets by status Multiple status values can be provided with comma separated strings @@ -92,7 +92,7 @@ Name | Type | Description | Required | Notes ### Return type -[**Vec**](Pet.md) +[**Vec**](Pet.md) ### Authorization @@ -108,7 +108,7 @@ Name | Type | Description | Required | Notes ## find_pets_by_tags -> Vec find_pets_by_tags(tags) +> Vec find_pets_by_tags(tags) Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -122,7 +122,7 @@ Name | Type | Description | Required | Notes ### Return type -[**Vec**](Pet.md) +[**Vec**](Pet.md) ### Authorization @@ -138,7 +138,7 @@ Name | Type | Description | Required | Notes ## get_pet_by_id -> crate::models::Pet get_pet_by_id(pet_id) +> models::Pet get_pet_by_id(pet_id) Find pet by ID Returns a single pet @@ -152,7 +152,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Pet**](Pet.md) +[**models::Pet**](Pet.md) ### Authorization @@ -168,7 +168,7 @@ Name | Type | Description | Required | Notes ## update_pet -> crate::models::Pet update_pet(pet) +> models::Pet update_pet(pet) Update an existing pet @@ -182,7 +182,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Pet**](Pet.md) +[**models::Pet**](Pet.md) ### Authorization @@ -230,7 +230,7 @@ Name | Type | Description | Required | Notes ## upload_file -> crate::models::ApiResponse upload_file(pet_id, additional_metadata, file) +> models::ApiResponse upload_file(pet_id, additional_metadata, file) uploads an image @@ -246,7 +246,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::ApiResponse**](ApiResponse.md) +[**models::ApiResponse**](ApiResponse.md) ### Authorization diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/StoreApi.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/StoreApi.md index 5796357f53ba..a513dfa1b5fa 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/StoreApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/StoreApi.md @@ -43,7 +43,7 @@ No authorization required ## get_inventory -> ::std::collections::HashMap get_inventory() +> std::collections::HashMap get_inventory() Returns pet inventories by status Returns a map of status codes to quantities @@ -54,7 +54,7 @@ This endpoint does not need any parameter. ### Return type -**::std::collections::HashMap** +**std::collections::HashMap** ### Authorization @@ -70,7 +70,7 @@ This endpoint does not need any parameter. ## get_order_by_id -> crate::models::Order get_order_by_id(order_id) +> models::Order get_order_by_id(order_id) Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -84,7 +84,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Order**](Order.md) +[**models::Order**](Order.md) ### Authorization @@ -100,7 +100,7 @@ No authorization required ## place_order -> crate::models::Order place_order(order) +> models::Order place_order(order) Place an order for a pet @@ -114,7 +114,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Order**](Order.md) +[**models::Order**](Order.md) ### Authorization diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/TestingApi.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/TestingApi.md index ca0c06e06a05..9c26af249127 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/TestingApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/TestingApi.md @@ -36,7 +36,7 @@ No authorization required ## tests_type_testing_get -> crate::models::TypeTesting tests_type_testing_get() +> models::TypeTesting tests_type_testing_get() Route to test the TypeTesting schema ### Parameters @@ -45,7 +45,7 @@ This endpoint does not need any parameter. ### Return type -[**crate::models::TypeTesting**](TypeTesting.md) +[**models::TypeTesting**](TypeTesting.md) ### Authorization diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/UserApi.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/UserApi.md index 03693014b925..d536057ae15a 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/UserApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/UserApi.md @@ -57,7 +57,7 @@ Creates list of users with given input array Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**user** | [**Vec**](User.md) | List of user object | [required] | +**user** | [**Vec**](User.md) | List of user object | [required] | ### Return type @@ -87,7 +87,7 @@ Creates list of users with given input array Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**user** | [**Vec**](User.md) | List of user object | [required] | +**user** | [**Vec**](User.md) | List of user object | [required] | ### Return type @@ -137,7 +137,7 @@ Name | Type | Description | Required | Notes ## get_user_by_name -> crate::models::User get_user_by_name(username) +> models::User get_user_by_name(username) Get user by user name @@ -151,7 +151,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::User**](User.md) +[**models::User**](User.md) ### Authorization diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/pet_api.rs index d7971339d2c6..a7d5a4168acf 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/pet_api.rs @@ -83,7 +83,7 @@ pub enum UploadFileError { /// -pub fn add_pet(configuration: &configuration::Configuration, pet: crate::models::Pet) -> Result> { +pub fn add_pet(configuration: &configuration::Configuration, pet: crate::models::Pet) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -175,7 +175,7 @@ pub fn delete_pet(configuration: &configuration::Configuration, pet_id: i64, api } /// Multiple status values can be provided with comma separated strings -pub fn find_pets_by_status(configuration: &configuration::Configuration, status: Vec) -> Result, Error> { +pub fn find_pets_by_status(configuration: &configuration::Configuration, status: Vec) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -223,7 +223,7 @@ pub fn find_pets_by_status(configuration: &configuration::Configuration, status: } /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. -pub fn find_pets_by_tags(configuration: &configuration::Configuration, tags: Vec) -> Result, Error> { +pub fn find_pets_by_tags(configuration: &configuration::Configuration, tags: Vec) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -271,7 +271,7 @@ pub fn find_pets_by_tags(configuration: &configuration::Configuration, tags: Vec } /// Returns a single pet -pub fn get_pet_by_id(configuration: &configuration::Configuration, pet_id: i64) -> Result> { +pub fn get_pet_by_id(configuration: &configuration::Configuration, pet_id: i64) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -320,7 +320,7 @@ pub fn get_pet_by_id(configuration: &configuration::Configuration, pet_id: i64) } /// -pub fn update_pet(configuration: &configuration::Configuration, pet: crate::models::Pet) -> Result> { +pub fn update_pet(configuration: &configuration::Configuration, pet: crate::models::Pet) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -417,7 +417,7 @@ pub fn update_pet_with_form(configuration: &configuration::Configuration, pet_id } /// -pub fn upload_file(configuration: &configuration::Configuration, pet_id: i64, additional_metadata: Option<&str>, file: Option) -> Result> { +pub fn upload_file(configuration: &configuration::Configuration, pet_id: i64, additional_metadata: Option<&str>, file: Option) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/store_api.rs index 9c777efebfa0..bc381ce214dc 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/store_api.rs @@ -78,7 +78,7 @@ pub fn delete_order(configuration: &configuration::Configuration, order_id: &str } /// Returns a map of status codes to quantities -pub fn get_inventory(configuration: &configuration::Configuration, ) -> Result<::std::collections::HashMap, Error> { +pub fn get_inventory(configuration: &configuration::Configuration, ) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -127,7 +127,7 @@ pub fn get_inventory(configuration: &configuration::Configuration, ) -> Result<: } /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions -pub fn get_order_by_id(configuration: &configuration::Configuration, order_id: i64) -> Result> { +pub fn get_order_by_id(configuration: &configuration::Configuration, order_id: i64) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -155,7 +155,7 @@ pub fn get_order_by_id(configuration: &configuration::Configuration, order_id: i } /// -pub fn place_order(configuration: &configuration::Configuration, order: crate::models::Order) -> Result> { +pub fn place_order(configuration: &configuration::Configuration, order: crate::models::Order) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/testing_api.rs index 1f5d382b3b13..c553548a7328 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/testing_api.rs @@ -57,7 +57,7 @@ pub fn tests_file_response_get(configuration: &configuration::Configuration, ) - } } -pub fn tests_type_testing_get(configuration: &configuration::Configuration, ) -> Result> { +pub fn tests_type_testing_get(configuration: &configuration::Configuration, ) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/user_api.rs index 953aa2713f26..aba69fdaee2a 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/user_api.rs @@ -134,7 +134,7 @@ pub fn create_user(configuration: &configuration::Configuration, user: crate::mo } /// -pub fn create_users_with_array_input(configuration: &configuration::Configuration, user: Vec) -> Result<(), Error> { +pub fn create_users_with_array_input(configuration: &configuration::Configuration, user: Vec) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -184,7 +184,7 @@ pub fn create_users_with_array_input(configuration: &configuration::Configuratio } /// -pub fn create_users_with_list_input(configuration: &configuration::Configuration, user: Vec) -> Result<(), Error> { +pub fn create_users_with_list_input(configuration: &configuration::Configuration, user: Vec) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -283,7 +283,7 @@ pub fn delete_user(configuration: &configuration::Configuration, username: &str) } /// -pub fn get_user_by_name(configuration: &configuration::Configuration, username: &str) -> Result> { +pub fn get_user_by_name(configuration: &configuration::Configuration, username: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/lib.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/lib.rs index c1dd666f7957..1ac114198fdd 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/lib.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/lib.rs @@ -1,3 +1,5 @@ +#![allow(unused_imports)] + #[macro_use] extern crate serde_derive; diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/action_container.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/action_container.rs index 7e2d9a0717f9..20fcdf51c3fa 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/action_container.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/action_container.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * @@ -14,11 +16,11 @@ #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ActionContainer { #[serde(rename = "action")] - pub action: Box, + pub action: Box, } impl ActionContainer { - pub fn new(action: crate::models::Baz) -> ActionContainer { + pub fn new(action: Baz) -> ActionContainer { ActionContainer { action: Box::new(action), } diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/api_response.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/api_response.rs index 1741c9ff9cdd..001383c97f18 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/api_response.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/api_response.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/array_item_ref_test.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/array_item_ref_test.rs index 09e7611f0ef4..1a7d5f38a0b5 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/array_item_ref_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/array_item_ref_test.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * @@ -15,14 +17,14 @@ #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ArrayItemRefTest { #[serde(rename = "list_with_array_ref")] - pub list_with_array_ref: Vec>, + pub list_with_array_ref: Vec, #[serde(rename = "list_with_object_ref")] - pub list_with_object_ref: Vec<::std::collections::HashMap>, + pub list_with_object_ref: Vec, } impl ArrayItemRefTest { /// Test handling of object reference in arrays - pub fn new(list_with_array_ref: Vec>, list_with_object_ref: Vec<::std::collections::HashMap>) -> ArrayItemRefTest { + pub fn new(list_with_array_ref: Vec, list_with_object_ref: Vec) -> ArrayItemRefTest { ArrayItemRefTest { list_with_array_ref, list_with_object_ref, diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/baz.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/baz.rs index 94f8c5aa6aa4..e572fe204124 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/baz.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/baz.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/category.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/category.rs index e62af6878b9e..067aad5e54fd 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/category.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/category.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/enum_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/enum_array_testing.rs index 4ad77233833a..860f9d02dcf1 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/enum_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/enum_array_testing.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/model_return.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/model_return.rs index d9619444f707..45f12f85fec1 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/model_return.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/model_return.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/nullable_array.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/nullable_array.rs index f177f16192c5..aad44660b5dc 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/nullable_array.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/nullable_array.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/optional_testing.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/optional_testing.rs index e8f7af5c012e..9f24111bd076 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/optional_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/optional_testing.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/order.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/order.rs index e3385c8ff03c..3e916b84b379 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/order.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/order.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/pet.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/pet.rs index 6661e036994b..6097058b792e 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/pet.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/pet.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * @@ -17,13 +19,13 @@ pub struct Pet { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, #[serde(rename = "category", skip_serializing_if = "Option::is_none")] - pub category: Option>, + pub category: Option>, #[serde(rename = "name")] pub name: String, #[serde(rename = "photoUrls")] pub photo_urls: Vec, #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] - pub tags: Option>, + pub tags: Option>, /// pet status in the store #[serde(rename = "status", skip_serializing_if = "Option::is_none")] pub status: Option, diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/property_test.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/property_test.rs index e496a02311c4..330649729037 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/property_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/property_test.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/tag.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/tag.rs index 1786ebec3ac2..d21f0aafd8e6 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/tag.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/tag.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/type_testing.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/type_testing.rs index 079ac75daff8..4f0a1819194b 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/type_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/type_testing.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/unique_item_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/unique_item_array_testing.rs index 854ca0916ae1..93efbd1aa241 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/unique_item_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/unique_item_array_testing.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/user.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/user.rs index c52c16ba3162..f8153db61739 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/user.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/user.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/ActionContainer.md b/samples/client/petstore/rust/reqwest/petstore/docs/ActionContainer.md index 8490ec5d821b..0d690bd0c56f 100644 --- a/samples/client/petstore/rust/reqwest/petstore/docs/ActionContainer.md +++ b/samples/client/petstore/rust/reqwest/petstore/docs/ActionContainer.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | [**crate::models::Baz**](Baz.md) | | +**action** | [**Baz**](Baz.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/ArrayItemRefTest.md b/samples/client/petstore/rust/reqwest/petstore/docs/ArrayItemRefTest.md index 57e521d9ce6a..2359c95a1866 100644 --- a/samples/client/petstore/rust/reqwest/petstore/docs/ArrayItemRefTest.md +++ b/samples/client/petstore/rust/reqwest/petstore/docs/ArrayItemRefTest.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**list_with_array_ref** | [**Vec>**](array.md) | | -**list_with_object_ref** | [**Vec<::std::collections::HashMap>**](map.md) | | +**list_with_array_ref** | [**Vec**](Vec.md) | | +**list_with_object_ref** | [**Vec**](std::collections::HashMap.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/Pet.md b/samples/client/petstore/rust/reqwest/petstore/docs/Pet.md index 27886889d1d4..e7a72caa16e9 100644 --- a/samples/client/petstore/rust/reqwest/petstore/docs/Pet.md +++ b/samples/client/petstore/rust/reqwest/petstore/docs/Pet.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | Option<**i64**> | | [optional] -**category** | Option<[**crate::models::Category**](Category.md)> | | [optional] +**category** | Option<[**models::Category**](Category.md)> | | [optional] **name** | **String** | | **photo_urls** | **Vec** | | -**tags** | Option<[**Vec**](Tag.md)> | | [optional] +**tags** | Option<[**Vec**](Tag.md)> | | [optional] **status** | Option<**String**> | pet status in the store | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/PetApi.md b/samples/client/petstore/rust/reqwest/petstore/docs/PetApi.md index 5adc9334151a..d503facb903c 100644 --- a/samples/client/petstore/rust/reqwest/petstore/docs/PetApi.md +++ b/samples/client/petstore/rust/reqwest/petstore/docs/PetApi.md @@ -17,7 +17,7 @@ Method | HTTP request | Description ## add_pet -> crate::models::Pet add_pet(pet) +> models::Pet add_pet(pet) Add a new pet to the store @@ -31,7 +31,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Pet**](Pet.md) +[**models::Pet**](Pet.md) ### Authorization @@ -78,7 +78,7 @@ Name | Type | Description | Required | Notes ## find_pets_by_status -> Vec find_pets_by_status(status) +> Vec find_pets_by_status(status) Finds Pets by status Multiple status values can be provided with comma separated strings @@ -92,7 +92,7 @@ Name | Type | Description | Required | Notes ### Return type -[**Vec**](Pet.md) +[**Vec**](Pet.md) ### Authorization @@ -108,7 +108,7 @@ Name | Type | Description | Required | Notes ## find_pets_by_tags -> Vec find_pets_by_tags(tags) +> Vec find_pets_by_tags(tags) Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -122,7 +122,7 @@ Name | Type | Description | Required | Notes ### Return type -[**Vec**](Pet.md) +[**Vec**](Pet.md) ### Authorization @@ -138,7 +138,7 @@ Name | Type | Description | Required | Notes ## get_pet_by_id -> crate::models::Pet get_pet_by_id(pet_id) +> models::Pet get_pet_by_id(pet_id) Find pet by ID Returns a single pet @@ -152,7 +152,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Pet**](Pet.md) +[**models::Pet**](Pet.md) ### Authorization @@ -168,7 +168,7 @@ Name | Type | Description | Required | Notes ## update_pet -> crate::models::Pet update_pet(pet) +> models::Pet update_pet(pet) Update an existing pet @@ -182,7 +182,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Pet**](Pet.md) +[**models::Pet**](Pet.md) ### Authorization @@ -230,7 +230,7 @@ Name | Type | Description | Required | Notes ## upload_file -> crate::models::ApiResponse upload_file(pet_id, additional_metadata, file) +> models::ApiResponse upload_file(pet_id, additional_metadata, file) uploads an image @@ -246,7 +246,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::ApiResponse**](ApiResponse.md) +[**models::ApiResponse**](ApiResponse.md) ### Authorization diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/StoreApi.md b/samples/client/petstore/rust/reqwest/petstore/docs/StoreApi.md index 5796357f53ba..a513dfa1b5fa 100644 --- a/samples/client/petstore/rust/reqwest/petstore/docs/StoreApi.md +++ b/samples/client/petstore/rust/reqwest/petstore/docs/StoreApi.md @@ -43,7 +43,7 @@ No authorization required ## get_inventory -> ::std::collections::HashMap get_inventory() +> std::collections::HashMap get_inventory() Returns pet inventories by status Returns a map of status codes to quantities @@ -54,7 +54,7 @@ This endpoint does not need any parameter. ### Return type -**::std::collections::HashMap** +**std::collections::HashMap** ### Authorization @@ -70,7 +70,7 @@ This endpoint does not need any parameter. ## get_order_by_id -> crate::models::Order get_order_by_id(order_id) +> models::Order get_order_by_id(order_id) Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -84,7 +84,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Order**](Order.md) +[**models::Order**](Order.md) ### Authorization @@ -100,7 +100,7 @@ No authorization required ## place_order -> crate::models::Order place_order(order) +> models::Order place_order(order) Place an order for a pet @@ -114,7 +114,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::Order**](Order.md) +[**models::Order**](Order.md) ### Authorization diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/TestingApi.md b/samples/client/petstore/rust/reqwest/petstore/docs/TestingApi.md index ca0c06e06a05..9c26af249127 100644 --- a/samples/client/petstore/rust/reqwest/petstore/docs/TestingApi.md +++ b/samples/client/petstore/rust/reqwest/petstore/docs/TestingApi.md @@ -36,7 +36,7 @@ No authorization required ## tests_type_testing_get -> crate::models::TypeTesting tests_type_testing_get() +> models::TypeTesting tests_type_testing_get() Route to test the TypeTesting schema ### Parameters @@ -45,7 +45,7 @@ This endpoint does not need any parameter. ### Return type -[**crate::models::TypeTesting**](TypeTesting.md) +[**models::TypeTesting**](TypeTesting.md) ### Authorization diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/UserApi.md b/samples/client/petstore/rust/reqwest/petstore/docs/UserApi.md index 03693014b925..d536057ae15a 100644 --- a/samples/client/petstore/rust/reqwest/petstore/docs/UserApi.md +++ b/samples/client/petstore/rust/reqwest/petstore/docs/UserApi.md @@ -57,7 +57,7 @@ Creates list of users with given input array Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**user** | [**Vec**](User.md) | List of user object | [required] | +**user** | [**Vec**](User.md) | List of user object | [required] | ### Return type @@ -87,7 +87,7 @@ Creates list of users with given input array Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**user** | [**Vec**](User.md) | List of user object | [required] | +**user** | [**Vec**](User.md) | List of user object | [required] | ### Return type @@ -137,7 +137,7 @@ Name | Type | Description | Required | Notes ## get_user_by_name -> crate::models::User get_user_by_name(username) +> models::User get_user_by_name(username) Get user by user name @@ -151,7 +151,7 @@ Name | Type | Description | Required | Notes ### Return type -[**crate::models::User**](User.md) +[**models::User**](User.md) ### Authorization diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs index 5b70576ff0b4..b7bc8fa29639 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs @@ -83,7 +83,7 @@ pub enum UploadFileError { /// -pub fn add_pet(configuration: &configuration::Configuration, pet: crate::models::Pet) -> Result> { +pub fn add_pet(configuration: &configuration::Configuration, pet: crate::models::Pet) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -149,7 +149,7 @@ pub fn delete_pet(configuration: &configuration::Configuration, pet_id: i64, api } /// Multiple status values can be provided with comma separated strings -pub fn find_pets_by_status(configuration: &configuration::Configuration, status: Vec) -> Result, Error> { +pub fn find_pets_by_status(configuration: &configuration::Configuration, status: Vec) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -184,7 +184,7 @@ pub fn find_pets_by_status(configuration: &configuration::Configuration, status: } /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. -pub fn find_pets_by_tags(configuration: &configuration::Configuration, tags: Vec) -> Result, Error> { +pub fn find_pets_by_tags(configuration: &configuration::Configuration, tags: Vec) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -219,7 +219,7 @@ pub fn find_pets_by_tags(configuration: &configuration::Configuration, tags: Vec } /// Returns a single pet -pub fn get_pet_by_id(configuration: &configuration::Configuration, pet_id: i64) -> Result> { +pub fn get_pet_by_id(configuration: &configuration::Configuration, pet_id: i64) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -255,7 +255,7 @@ pub fn get_pet_by_id(configuration: &configuration::Configuration, pet_id: i64) } /// -pub fn update_pet(configuration: &configuration::Configuration, pet: crate::models::Pet) -> Result> { +pub fn update_pet(configuration: &configuration::Configuration, pet: crate::models::Pet) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -326,7 +326,7 @@ pub fn update_pet_with_form(configuration: &configuration::Configuration, pet_id } /// -pub fn upload_file(configuration: &configuration::Configuration, pet_id: i64, additional_metadata: Option<&str>, file: Option) -> Result> { +pub fn upload_file(configuration: &configuration::Configuration, pet_id: i64, additional_metadata: Option<&str>, file: Option) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs index 000983a6f0e9..c49837f4ecb2 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs @@ -78,7 +78,7 @@ pub fn delete_order(configuration: &configuration::Configuration, order_id: &str } /// Returns a map of status codes to quantities -pub fn get_inventory(configuration: &configuration::Configuration, ) -> Result<::std::collections::HashMap, Error> { +pub fn get_inventory(configuration: &configuration::Configuration, ) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -114,7 +114,7 @@ pub fn get_inventory(configuration: &configuration::Configuration, ) -> Result<: } /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions -pub fn get_order_by_id(configuration: &configuration::Configuration, order_id: i64) -> Result> { +pub fn get_order_by_id(configuration: &configuration::Configuration, order_id: i64) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -142,7 +142,7 @@ pub fn get_order_by_id(configuration: &configuration::Configuration, order_id: i } /// -pub fn place_order(configuration: &configuration::Configuration, order: crate::models::Order) -> Result> { +pub fn place_order(configuration: &configuration::Configuration, order: crate::models::Order) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/testing_api.rs index 1f5d382b3b13..c553548a7328 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/testing_api.rs @@ -57,7 +57,7 @@ pub fn tests_file_response_get(configuration: &configuration::Configuration, ) - } } -pub fn tests_type_testing_get(configuration: &configuration::Configuration, ) -> Result> { +pub fn tests_type_testing_get(configuration: &configuration::Configuration, ) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs index 4f8b6cdeb31b..99284e8b73cb 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs @@ -121,7 +121,7 @@ pub fn create_user(configuration: &configuration::Configuration, user: crate::mo } /// -pub fn create_users_with_array_input(configuration: &configuration::Configuration, user: Vec) -> Result<(), Error> { +pub fn create_users_with_array_input(configuration: &configuration::Configuration, user: Vec) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -158,7 +158,7 @@ pub fn create_users_with_array_input(configuration: &configuration::Configuratio } /// -pub fn create_users_with_list_input(configuration: &configuration::Configuration, user: Vec) -> Result<(), Error> { +pub fn create_users_with_list_input(configuration: &configuration::Configuration, user: Vec) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -231,7 +231,7 @@ pub fn delete_user(configuration: &configuration::Configuration, username: &str) } /// -pub fn get_user_by_name(configuration: &configuration::Configuration, username: &str) -> Result> { +pub fn get_user_by_name(configuration: &configuration::Configuration, username: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/lib.rs b/samples/client/petstore/rust/reqwest/petstore/src/lib.rs index c1dd666f7957..1ac114198fdd 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/lib.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/lib.rs @@ -1,3 +1,5 @@ +#![allow(unused_imports)] + #[macro_use] extern crate serde_derive; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/action_container.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/action_container.rs index 7e2d9a0717f9..20fcdf51c3fa 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/action_container.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/action_container.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * @@ -14,11 +16,11 @@ #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ActionContainer { #[serde(rename = "action")] - pub action: Box, + pub action: Box, } impl ActionContainer { - pub fn new(action: crate::models::Baz) -> ActionContainer { + pub fn new(action: Baz) -> ActionContainer { ActionContainer { action: Box::new(action), } diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/api_response.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/api_response.rs index 1741c9ff9cdd..001383c97f18 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/api_response.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/api_response.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/array_item_ref_test.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/array_item_ref_test.rs index 09e7611f0ef4..1a7d5f38a0b5 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/array_item_ref_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/array_item_ref_test.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * @@ -15,14 +17,14 @@ #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ArrayItemRefTest { #[serde(rename = "list_with_array_ref")] - pub list_with_array_ref: Vec>, + pub list_with_array_ref: Vec, #[serde(rename = "list_with_object_ref")] - pub list_with_object_ref: Vec<::std::collections::HashMap>, + pub list_with_object_ref: Vec, } impl ArrayItemRefTest { /// Test handling of object reference in arrays - pub fn new(list_with_array_ref: Vec>, list_with_object_ref: Vec<::std::collections::HashMap>) -> ArrayItemRefTest { + pub fn new(list_with_array_ref: Vec, list_with_object_ref: Vec) -> ArrayItemRefTest { ArrayItemRefTest { list_with_array_ref, list_with_object_ref, diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/baz.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/baz.rs index 94f8c5aa6aa4..e572fe204124 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/baz.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/baz.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/category.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/category.rs index e62af6878b9e..067aad5e54fd 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/category.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/category.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/enum_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/enum_array_testing.rs index 4ad77233833a..860f9d02dcf1 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/enum_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/enum_array_testing.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/model_return.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/model_return.rs index d9619444f707..45f12f85fec1 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/model_return.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/model_return.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/nullable_array.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/nullable_array.rs index f177f16192c5..aad44660b5dc 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/nullable_array.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/nullable_array.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/optional_testing.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/optional_testing.rs index e8f7af5c012e..9f24111bd076 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/optional_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/optional_testing.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/order.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/order.rs index 089fc80445de..8774db8d4e94 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/order.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/order.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs index 6661e036994b..6097058b792e 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * @@ -17,13 +19,13 @@ pub struct Pet { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, #[serde(rename = "category", skip_serializing_if = "Option::is_none")] - pub category: Option>, + pub category: Option>, #[serde(rename = "name")] pub name: String, #[serde(rename = "photoUrls")] pub photo_urls: Vec, #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] - pub tags: Option>, + pub tags: Option>, /// pet status in the store #[serde(rename = "status", skip_serializing_if = "Option::is_none")] pub status: Option, diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/property_test.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/property_test.rs index e496a02311c4..330649729037 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/property_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/property_test.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/tag.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/tag.rs index 1786ebec3ac2..d21f0aafd8e6 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/tag.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/tag.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/type_testing.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/type_testing.rs index 079ac75daff8..4f0a1819194b 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/type_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/type_testing.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/unique_item_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/unique_item_array_testing.rs index 854ca0916ae1..93efbd1aa241 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/unique_item_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/unique_item_array_testing.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/user.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/user.rs index c52c16ba3162..f8153db61739 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/user.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/user.rs @@ -1,3 +1,5 @@ +use crate::models; + /* * OpenAPI Petstore * From aabda2332f6ce616f34982d8e98eeeea4643b2ad Mon Sep 17 00:00:00 2001 From: Artem Medvedev Date: Wed, 21 Feb 2024 02:38:29 +0100 Subject: [PATCH 03/13] fix: indentation in `impl Default` --- .../src/main/resources/rust/model.mustache | 6 +----- .../hyper/composed-oneof/src/models/create_state_request.rs | 3 +-- .../src/models/custom_one_of_array_schema_inner.rs | 3 +-- .../hyper/composed-oneof/src/models/custom_one_of_schema.rs | 3 +-- .../composed-oneof/src/models/get_state_200_response.rs | 3 +-- samples/client/others/rust/hyper/oneOf/src/models/entity.rs | 1 + .../client/others/rust/hyper/oneOf/src/models/entity_ref.rs | 1 + .../others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs | 1 - samples/client/others/rust/hyper/oneOf/src/models/fruit.rs | 3 +-- .../composed-oneof/src/models/create_state_request.rs | 3 +-- .../src/models/custom_one_of_array_schema_inner.rs | 3 +-- .../composed-oneof/src/models/custom_one_of_schema.rs | 3 +-- .../composed-oneof/src/models/get_state_200_response.rs | 3 +-- .../client/others/rust/reqwest/oneOf/src/models/entity.rs | 1 + .../others/rust/reqwest/oneOf/src/models/entity_ref.rs | 1 + .../rust/reqwest/oneOf/src/models/foo_ref_or_value.rs | 1 - .../client/others/rust/reqwest/oneOf/src/models/fruit.rs | 3 +-- 17 files changed, 15 insertions(+), 27 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/rust/model.mustache b/modules/openapi-generator/src/main/resources/rust/model.mustache index d29d31fa01b8..3b46e0c61cb5 100644 --- a/modules/openapi-generator/src/main/resources/rust/model.mustache +++ b/modules/openapi-generator/src/main/resources/rust/model.mustache @@ -85,11 +85,7 @@ impl Default for {{classname}} { {{{name}}}: Default::default(), {{/vars}} }{{/-first}}{{/mappedModels}} - {{/oneOf}} - {{^oneOf.isEmpty}} - {{#mappedModels}}{{#-first}}Self::{{{modelName}}}(Box::default()){{/-first}}{{/mappedModels}} - {{^mappedModels}}{{#composedSchemas.oneOf}}{{#-first}}Self::{{{name}}}(Box::default()){{/-first}}{{/composedSchemas.oneOf}}{{/mappedModels}} - {{/oneOf.isEmpty}} + {{/oneOf}}{{^oneOf.isEmpty}}{{#mappedModels}}{{#-first}}Self::{{{modelName}}}(Box::default()){{/-first}}{{/mappedModels}}{{^mappedModels}}{{#composedSchemas.oneOf}}{{#-first}}Self::{{{name}}}(Box::default()){{/-first}}{{/composedSchemas.oneOf}}{{/mappedModels}}{{/oneOf.isEmpty}} } } diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs index c44fba369433..7a83f9a4d045 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs @@ -23,8 +23,7 @@ pub enum CreateStateRequest { impl Default for CreateStateRequest { fn default() -> Self { - Self::ObjA(Box::default()) - + Self::ObjA(Box::default()) } } diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs index bf13e7602141..6147d36e4596 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs @@ -25,8 +25,7 @@ pub enum CustomOneOfArraySchemaInner { impl Default for CustomOneOfArraySchemaInner { fn default() -> Self { - Self::ObjA(Box::default()) - + Self::ObjA(Box::default()) } } diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs index 19e268847b7b..bedfbfbe287b 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs @@ -23,8 +23,7 @@ pub enum CustomOneOfSchema { impl Default for CustomOneOfSchema { fn default() -> Self { - Self::ObjA(Box::default()) - + Self::ObjA(Box::default()) } } diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs index eaef8d61847b..8f1e94058ecf 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs @@ -25,8 +25,7 @@ pub enum GetState200Response { impl Default for GetState200Response { fn default() -> Self { - Self::ObjA(Box::default()) - + Self::ObjA(Box::default()) } } diff --git a/samples/client/others/rust/hyper/oneOf/src/models/entity.rs b/samples/client/others/rust/hyper/oneOf/src/models/entity.rs index 53df00de0837..ec82e1d11c35 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/entity.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/entity.rs @@ -115,6 +115,7 @@ impl Default for Entity { at_schema_location: Default::default(), at_base_type: Default::default(), } + } } diff --git a/samples/client/others/rust/hyper/oneOf/src/models/entity_ref.rs b/samples/client/others/rust/hyper/oneOf/src/models/entity_ref.rs index 19b05eb50eb6..a4585a3e3ab9 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/entity_ref.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/entity_ref.rs @@ -70,6 +70,7 @@ impl Default for EntityRef { at_schema_location: Default::default(), at_base_type: Default::default(), } + } } diff --git a/samples/client/others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs b/samples/client/others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs index 1e2051ca199c..89ea309d569e 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs @@ -21,7 +21,6 @@ pub enum FooRefOrValue { impl Default for FooRefOrValue { fn default() -> Self { - Self::Foo(Box::default()) } } diff --git a/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs b/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs index ee9c2ca65a7a..d4a7b304d19e 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs @@ -23,8 +23,7 @@ pub enum Fruit { impl Default for Fruit { fn default() -> Self { - Self::Apple(Box::default()) - + Self::Apple(Box::default()) } } diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs index c44fba369433..7a83f9a4d045 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs @@ -23,8 +23,7 @@ pub enum CreateStateRequest { impl Default for CreateStateRequest { fn default() -> Self { - Self::ObjA(Box::default()) - + Self::ObjA(Box::default()) } } diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs index bf13e7602141..6147d36e4596 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs @@ -25,8 +25,7 @@ pub enum CustomOneOfArraySchemaInner { impl Default for CustomOneOfArraySchemaInner { fn default() -> Self { - Self::ObjA(Box::default()) - + Self::ObjA(Box::default()) } } diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs index 19e268847b7b..bedfbfbe287b 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs @@ -23,8 +23,7 @@ pub enum CustomOneOfSchema { impl Default for CustomOneOfSchema { fn default() -> Self { - Self::ObjA(Box::default()) - + Self::ObjA(Box::default()) } } diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs index eaef8d61847b..8f1e94058ecf 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs @@ -25,8 +25,7 @@ pub enum GetState200Response { impl Default for GetState200Response { fn default() -> Self { - Self::ObjA(Box::default()) - + Self::ObjA(Box::default()) } } diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/entity.rs b/samples/client/others/rust/reqwest/oneOf/src/models/entity.rs index 53df00de0837..ec82e1d11c35 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/entity.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/entity.rs @@ -115,6 +115,7 @@ impl Default for Entity { at_schema_location: Default::default(), at_base_type: Default::default(), } + } } diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/entity_ref.rs b/samples/client/others/rust/reqwest/oneOf/src/models/entity_ref.rs index 19b05eb50eb6..a4585a3e3ab9 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/entity_ref.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/entity_ref.rs @@ -70,6 +70,7 @@ impl Default for EntityRef { at_schema_location: Default::default(), at_base_type: Default::default(), } + } } diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref_or_value.rs b/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref_or_value.rs index 1e2051ca199c..89ea309d569e 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref_or_value.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref_or_value.rs @@ -21,7 +21,6 @@ pub enum FooRefOrValue { impl Default for FooRefOrValue { fn default() -> Self { - Self::Foo(Box::default()) } } diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs b/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs index ee9c2ca65a7a..d4a7b304d19e 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs @@ -23,8 +23,7 @@ pub enum Fruit { impl Default for Fruit { fn default() -> Self { - Self::Apple(Box::default()) - + Self::Apple(Box::default()) } } From 671003b7896cbdc0a82c0b41448514a36280a1b2 Mon Sep 17 00:00:00 2001 From: Artem Medvedev Date: Wed, 21 Feb 2024 03:57:30 +0100 Subject: [PATCH 04/13] missing fixes --- .../codegen/languages/RustClientCodegen.java | 21 ++++++++------ .../main/resources/rust/hyper/api.mustache | 1 + .../src/main/resources/rust/model.mustache | 12 ++------ .../main/resources/rust/reqwest/api.mustache | 2 +- samples/client/others/rust/Cargo.lock | 28 +++++++++++++++++++ .../composed-oneof/src/apis/default_api.rs | 1 + .../src/models/create_state_request.rs | 4 +-- .../custom_one_of_array_schema_inner.rs | 6 ++-- .../src/models/custom_one_of_schema.rs | 4 +-- .../src/models/get_state_200_response.rs | 6 ++-- .../hyper/emptyObject/src/apis/default_api.rs | 1 + .../oneOf-array-map/src/apis/default_api.rs | 1 + .../rust/hyper/oneOf/src/apis/bar_api.rs | 1 + .../rust/hyper/oneOf/src/apis/foo_api.rs | 1 + .../rust/hyper/oneOf/src/models/fruit.rs | 4 +-- .../src/apis/default_api.rs | 2 +- .../composed-oneof/src/apis/default_api.rs | 2 +- .../src/models/create_state_request.rs | 4 +-- .../custom_one_of_array_schema_inner.rs | 6 ++-- .../src/models/custom_one_of_schema.rs | 4 +-- .../src/models/get_state_200_response.rs | 6 ++-- .../emptyObject/src/apis/default_api.rs | 2 +- .../oneOf-array-map/src/apis/default_api.rs | 2 +- .../rust/reqwest/oneOf/src/apis/bar_api.rs | 2 +- .../rust/reqwest/oneOf/src/apis/foo_api.rs | 2 +- .../rust/reqwest/oneOf/src/models/fruit.rs | 4 +-- .../rust/hyper/petstore/src/apis/fake_api.rs | 1 + .../rust/hyper/petstore/src/apis/pet_api.rs | 1 + .../rust/hyper/petstore/src/apis/store_api.rs | 1 + .../hyper/petstore/src/apis/testing_api.rs | 1 + .../rust/hyper/petstore/src/apis/user_api.rs | 1 + .../reqwest/name-mapping/src/apis/fake_api.rs | 2 +- .../src/apis/fake_api.rs | 2 +- .../src/apis/pet_api.rs | 2 +- .../src/apis/store_api.rs | 2 +- .../src/apis/testing_api.rs | 2 +- .../src/apis/user_api.rs | 2 +- .../petstore-async/src/apis/fake_api.rs | 2 +- .../petstore-async/src/apis/pet_api.rs | 2 +- .../petstore-async/src/apis/store_api.rs | 2 +- .../petstore-async/src/apis/testing_api.rs | 2 +- .../petstore-async/src/apis/user_api.rs | 2 +- .../src/apis/fake_api.rs | 2 +- .../src/apis/pet_api.rs | 2 +- .../src/apis/store_api.rs | 2 +- .../src/apis/testing_api.rs | 2 +- .../src/apis/user_api.rs | 2 +- .../reqwest/petstore/src/apis/fake_api.rs | 2 +- .../rust/reqwest/petstore/src/apis/pet_api.rs | 2 +- .../reqwest/petstore/src/apis/store_api.rs | 2 +- .../reqwest/petstore/src/apis/testing_api.rs | 2 +- .../reqwest/petstore/src/apis/user_api.rs | 2 +- 52 files changed, 107 insertions(+), 69 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java index 841ad961a290..7135f5261789 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java @@ -19,10 +19,7 @@ import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; -import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.FileSchema; -import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.oas.models.media.StringSchema; +import io.swagger.v3.oas.models.media.*; import io.swagger.v3.parser.util.SchemaTypeUtil; import joptsimple.internal.Strings; import org.openapitools.codegen.*; @@ -42,6 +39,7 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.*; +import java.util.stream.Collectors; public class RustClientCodegen extends AbstractRustCodegen implements CodegenConfig { private final Logger LOGGER = LoggerFactory.getLogger(RustClientCodegen.class); @@ -221,6 +219,14 @@ public CodegenModel fromModel(String name, Schema model) { throw new RuntimeException("oneOf size does not match the model"); } + Map mappedNameByRef = Optional.ofNullable(model.getDiscriminator()) + .map(Discriminator::getMapping) + .map(mapping -> mapping.entrySet() + .stream() + .collect(Collectors.toMap(Map.Entry::getValue, Map.Entry::getKey)) + ) + .orElse(Collections.emptyMap()); + for (int i = 0; i < oneOfs.size(); i++) { CodegenProperty oneOf = oneOfs.get(i); Schema schema = schemas.get(i); @@ -228,6 +234,9 @@ public CodegenModel fromModel(String name, Schema model) { if (aliasType.startsWith("models::")) { aliasType = aliasType.substring("models::".length()); } + if (oneOf.getRef() != null) { + oneOf.setBaseName(mappedNameByRef.get(oneOf.getRef())); + } oneOf.setName(aliasType); } } @@ -239,10 +248,6 @@ public CodegenModel fromModel(String name, Schema model) { public ModelsMap postProcessModels(ModelsMap objs) { // Remove the discriminator field from the model, serde will take care of this for (ModelMap model : objs.getModels()) { - System.out.println("\nMODEL: \n\n"); - System.out.println(model); - System.out.println("\n\n\n"); - CodegenModel cm = model.getModel(); if (cm.discriminator != null) { diff --git a/modules/openapi-generator/src/main/resources/rust/hyper/api.mustache b/modules/openapi-generator/src/main/resources/rust/hyper/api.mustache index dffab3ce8a7a..57d9e9af5c8b 100644 --- a/modules/openapi-generator/src/main/resources/rust/hyper/api.mustache +++ b/modules/openapi-generator/src/main/resources/rust/hyper/api.mustache @@ -8,6 +8,7 @@ use std::option::Option; use hyper; use futures::Future; +use crate::models; use super::{Error, configuration}; use super::request as __internal_request; diff --git a/modules/openapi-generator/src/main/resources/rust/model.mustache b/modules/openapi-generator/src/main/resources/rust/model.mustache index 3b46e0c61cb5..4bb93ff6e967 100644 --- a/modules/openapi-generator/src/main/resources/rust/model.mustache +++ b/modules/openapi-generator/src/main/resources/rust/model.mustache @@ -60,21 +60,15 @@ pub enum {{{classname}}} { {{/mappedModels}} {{/oneOf}} {{^oneOf.isEmpty}} - {{#mappedModels}} - {{#description}} - /// {{{.}}} - {{/description}} - #[serde(rename="{{mappingName}}")] - {{{modelName}}}(Box<{{{modelName}}}>), - {{/mappedModels}} - {{^mappedModels}} {{#composedSchemas.oneOf}} {{#description}} /// {{{.}}} {{/description}} + {{#baseName}} + #[serde(rename="{{{.}}}")] + {{/baseName}} {{{name}}}(Box<{{{dataType}}}>), {{/composedSchemas.oneOf}} - {{/mappedModels}} {{/oneOf.isEmpty}} } diff --git a/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache b/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache index f848674e1371..44cae73cbaa5 100644 --- a/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache +++ b/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache @@ -2,7 +2,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; {{#operations}} diff --git a/samples/client/others/rust/Cargo.lock b/samples/client/others/rust/Cargo.lock index 5c3045aa7c89..fd0e7be93694 100644 --- a/samples/client/others/rust/Cargo.lock +++ b/samples/client/others/rust/Cargo.lock @@ -615,6 +615,34 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +[[package]] +name = "oneof-array-map-hyper" +version = "0.0.1" +dependencies = [ + "base64 0.7.0", + "futures", + "http", + "hyper", + "hyper-tls", + "serde", + "serde_derive", + "serde_json", + "url", + "uuid", +] + +[[package]] +name = "oneof-array-map-reqwest" +version = "0.0.1" +dependencies = [ + "reqwest", + "serde", + "serde_derive", + "serde_json", + "url", + "uuid", +] + [[package]] name = "oneof-hyper" version = "0.0.1" diff --git a/samples/client/others/rust/hyper/composed-oneof/src/apis/default_api.rs b/samples/client/others/rust/hyper/composed-oneof/src/apis/default_api.rs index bc7d7d735ecd..2a1f81b06bf6 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/apis/default_api.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/apis/default_api.rs @@ -17,6 +17,7 @@ use std::option::Option; use hyper; use futures::Future; +use crate::models; use super::{Error, configuration}; use super::request as __internal_request; diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs index 7a83f9a4d045..751362a22d5d 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs @@ -16,9 +16,9 @@ use crate::models; #[serde(tag = "realtype")] pub enum CreateStateRequest { #[serde(rename="a-type")] - ObjA(Box), + ObjA(Box), #[serde(rename="b-type")] - ObjB(Box), + ObjB(Box), } impl Default for CreateStateRequest { diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs index 6147d36e4596..255030da6686 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs @@ -16,11 +16,11 @@ use crate::models; #[serde(tag = "realtype")] pub enum CustomOneOfArraySchemaInner { #[serde(rename="a-type")] - ObjA(Box), + ObjA(Box), #[serde(rename="b-type")] - ObjB(Box), + ObjB(Box), #[serde(rename="c-type")] - ObjC(Box), + ObjC(Box), } impl Default for CustomOneOfArraySchemaInner { diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs index bedfbfbe287b..0bddc69a829a 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs @@ -16,9 +16,9 @@ use crate::models; #[serde(tag = "realtype")] pub enum CustomOneOfSchema { #[serde(rename="a-type")] - ObjA(Box), + ObjA(Box), #[serde(rename="b-type")] - ObjB(Box), + ObjB(Box), } impl Default for CustomOneOfSchema { diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs index 8f1e94058ecf..b87bf89b7627 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs @@ -16,11 +16,11 @@ use crate::models; #[serde(tag = "realtype")] pub enum GetState200Response { #[serde(rename="a-type")] - ObjA(Box), + ObjA(Box), #[serde(rename="b-type")] - ObjB(Box), + ObjB(Box), #[serde(rename="d-type")] - ObjD(Box), + ObjD(Box), } impl Default for GetState200Response { diff --git a/samples/client/others/rust/hyper/emptyObject/src/apis/default_api.rs b/samples/client/others/rust/hyper/emptyObject/src/apis/default_api.rs index 3d6230b67041..1ad9fa3768e7 100644 --- a/samples/client/others/rust/hyper/emptyObject/src/apis/default_api.rs +++ b/samples/client/others/rust/hyper/emptyObject/src/apis/default_api.rs @@ -17,6 +17,7 @@ use std::option::Option; use hyper; use futures::Future; +use crate::models; use super::{Error, configuration}; use super::request as __internal_request; diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/apis/default_api.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/apis/default_api.rs index 53653461d99f..90082edd0eed 100644 --- a/samples/client/others/rust/hyper/oneOf-array-map/src/apis/default_api.rs +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/apis/default_api.rs @@ -17,6 +17,7 @@ use std::option::Option; use hyper; use futures::Future; +use crate::models; use super::{Error, configuration}; use super::request as __internal_request; diff --git a/samples/client/others/rust/hyper/oneOf/src/apis/bar_api.rs b/samples/client/others/rust/hyper/oneOf/src/apis/bar_api.rs index 27db239cdc86..e3d76e9197f7 100644 --- a/samples/client/others/rust/hyper/oneOf/src/apis/bar_api.rs +++ b/samples/client/others/rust/hyper/oneOf/src/apis/bar_api.rs @@ -17,6 +17,7 @@ use std::option::Option; use hyper; use futures::Future; +use crate::models; use super::{Error, configuration}; use super::request as __internal_request; diff --git a/samples/client/others/rust/hyper/oneOf/src/apis/foo_api.rs b/samples/client/others/rust/hyper/oneOf/src/apis/foo_api.rs index e3b6de5b371f..abea506ea5b0 100644 --- a/samples/client/others/rust/hyper/oneOf/src/apis/foo_api.rs +++ b/samples/client/others/rust/hyper/oneOf/src/apis/foo_api.rs @@ -17,6 +17,7 @@ use std::option::Option; use hyper; use futures::Future; +use crate::models; use super::{Error, configuration}; use super::request as __internal_request; diff --git a/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs b/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs index d4a7b304d19e..4f479ec09e90 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs @@ -16,9 +16,9 @@ use crate::models; #[serde(tag = "fruitType")] pub enum Fruit { #[serde(rename="APPLE")] - Apple(Box), + Apple(Box), #[serde(rename="BANANA")] - Banana(Box), + Banana(Box), } impl Default for Fruit { diff --git a/samples/client/others/rust/reqwest-regression-16119/src/apis/default_api.rs b/samples/client/others/rust/reqwest-regression-16119/src/apis/default_api.rs index 297c900efd2e..9f70938d1bc3 100644 --- a/samples/client/others/rust/reqwest-regression-16119/src/apis/default_api.rs +++ b/samples/client/others/rust/reqwest-regression-16119/src/apis/default_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/apis/default_api.rs b/samples/client/others/rust/reqwest/composed-oneof/src/apis/default_api.rs index c227c76d414f..c2a02e02dcd7 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/apis/default_api.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/apis/default_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs index 7a83f9a4d045..751362a22d5d 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs @@ -16,9 +16,9 @@ use crate::models; #[serde(tag = "realtype")] pub enum CreateStateRequest { #[serde(rename="a-type")] - ObjA(Box), + ObjA(Box), #[serde(rename="b-type")] - ObjB(Box), + ObjB(Box), } impl Default for CreateStateRequest { diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs index 6147d36e4596..255030da6686 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs @@ -16,11 +16,11 @@ use crate::models; #[serde(tag = "realtype")] pub enum CustomOneOfArraySchemaInner { #[serde(rename="a-type")] - ObjA(Box), + ObjA(Box), #[serde(rename="b-type")] - ObjB(Box), + ObjB(Box), #[serde(rename="c-type")] - ObjC(Box), + ObjC(Box), } impl Default for CustomOneOfArraySchemaInner { diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs index bedfbfbe287b..0bddc69a829a 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs @@ -16,9 +16,9 @@ use crate::models; #[serde(tag = "realtype")] pub enum CustomOneOfSchema { #[serde(rename="a-type")] - ObjA(Box), + ObjA(Box), #[serde(rename="b-type")] - ObjB(Box), + ObjB(Box), } impl Default for CustomOneOfSchema { diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs index 8f1e94058ecf..b87bf89b7627 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs @@ -16,11 +16,11 @@ use crate::models; #[serde(tag = "realtype")] pub enum GetState200Response { #[serde(rename="a-type")] - ObjA(Box), + ObjA(Box), #[serde(rename="b-type")] - ObjB(Box), + ObjB(Box), #[serde(rename="d-type")] - ObjD(Box), + ObjD(Box), } impl Default for GetState200Response { diff --git a/samples/client/others/rust/reqwest/emptyObject/src/apis/default_api.rs b/samples/client/others/rust/reqwest/emptyObject/src/apis/default_api.rs index 9f118fb45449..09832aa9133e 100644 --- a/samples/client/others/rust/reqwest/emptyObject/src/apis/default_api.rs +++ b/samples/client/others/rust/reqwest/emptyObject/src/apis/default_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/src/apis/default_api.rs b/samples/client/others/rust/reqwest/oneOf-array-map/src/apis/default_api.rs index 004c4913a470..b87854cd090c 100644 --- a/samples/client/others/rust/reqwest/oneOf-array-map/src/apis/default_api.rs +++ b/samples/client/others/rust/reqwest/oneOf-array-map/src/apis/default_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/others/rust/reqwest/oneOf/src/apis/bar_api.rs b/samples/client/others/rust/reqwest/oneOf/src/apis/bar_api.rs index 0025fe7913fb..f110aec984cc 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/apis/bar_api.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/apis/bar_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/others/rust/reqwest/oneOf/src/apis/foo_api.rs b/samples/client/others/rust/reqwest/oneOf/src/apis/foo_api.rs index f21b9a728087..52098ac7232d 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/apis/foo_api.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/apis/foo_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs b/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs index d4a7b304d19e..4f479ec09e90 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs @@ -16,9 +16,9 @@ use crate::models; #[serde(tag = "fruitType")] pub enum Fruit { #[serde(rename="APPLE")] - Apple(Box), + Apple(Box), #[serde(rename="BANANA")] - Banana(Box), + Banana(Box), } impl Default for Fruit { diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/fake_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/fake_api.rs index 49ffc5a3bce0..685b7262fff4 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/fake_api.rs @@ -17,6 +17,7 @@ use std::option::Option; use hyper; use futures::Future; +use crate::models; use super::{Error, configuration}; use super::request as __internal_request; diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs index edbf3e23bff2..3813527d3519 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs @@ -17,6 +17,7 @@ use std::option::Option; use hyper; use futures::Future; +use crate::models; use super::{Error, configuration}; use super::request as __internal_request; diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs index 6038b8e51325..c2afd7683abb 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs @@ -17,6 +17,7 @@ use std::option::Option; use hyper; use futures::Future; +use crate::models; use super::{Error, configuration}; use super::request as __internal_request; diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/testing_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/testing_api.rs index 60ab9102fef4..a7df972d7331 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/testing_api.rs @@ -17,6 +17,7 @@ use std::option::Option; use hyper; use futures::Future; +use crate::models; use super::{Error, configuration}; use super::request as __internal_request; diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs index dc14ad51bf58..ebef22602d0b 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs @@ -17,6 +17,7 @@ use std::option::Option; use hyper; use futures::Future; +use crate::models; use super::{Error, configuration}; use super::request as __internal_request; diff --git a/samples/client/petstore/rust/reqwest/name-mapping/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/name-mapping/src/apis/fake_api.rs index 7798ebce49d3..e40fc8b66c4d 100644 --- a/samples/client/petstore/rust/reqwest/name-mapping/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/name-mapping/src/apis/fake_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/fake_api.rs index f6179ab29827..78d3ba30ec0c 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/fake_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; /// struct for passing parameters to the method [`test_nullable_required_param`] diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/pet_api.rs index 2e56c86ce25c..a881754edf61 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/pet_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; /// struct for passing parameters to the method [`add_pet`] diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/store_api.rs index 43b6a5f39ed8..684a12e62dd0 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/store_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; /// struct for passing parameters to the method [`delete_order`] diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/testing_api.rs index cf422b2eba37..86f87242fcc6 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/testing_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/user_api.rs index 1d56ae6d3f26..c8200a2dc84a 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/user_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; /// struct for passing parameters to the method [`create_user`] diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/fake_api.rs index f6179ab29827..78d3ba30ec0c 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/fake_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; /// struct for passing parameters to the method [`test_nullable_required_param`] diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs index 2e56c86ce25c..a881754edf61 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; /// struct for passing parameters to the method [`add_pet`] diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs index 43b6a5f39ed8..684a12e62dd0 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; /// struct for passing parameters to the method [`delete_order`] diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/testing_api.rs index cf422b2eba37..86f87242fcc6 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/testing_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs index 1d56ae6d3f26..c8200a2dc84a 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; /// struct for passing parameters to the method [`create_user`] diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/fake_api.rs index d070648614aa..af7818dd030b 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/fake_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/pet_api.rs index a7d5a4168acf..9fe35d29c73c 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/pet_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/store_api.rs index bc381ce214dc..f15f14107786 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/store_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/testing_api.rs index c553548a7328..f6bca74913ea 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/testing_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/user_api.rs index aba69fdaee2a..00b8cc7b3efa 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/user_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/fake_api.rs index d070648614aa..af7818dd030b 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/fake_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs index b7bc8fa29639..c8612c474397 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs index c49837f4ecb2..3ee709fcf1b4 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/testing_api.rs index c553548a7328..f6bca74913ea 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/testing_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs index 99284e8b73cb..c157f85bea14 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs @@ -11,7 +11,7 @@ use reqwest; -use crate::apis::ResponseContent; +use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; From ca8cb9e85be7ae55ba934256adba7de898d2c879 Mon Sep 17 00:00:00 2001 From: Artem Medvedev Date: Wed, 21 Feb 2024 14:17:44 +0100 Subject: [PATCH 05/13] fix: correct typeDeclaration with unaliased schema --- .../languages/AbstractRustCodegen.java | 8 ++--- .../codegen/languages/RustClientCodegen.java | 30 ++++++++++++++++--- .../src/main/resources/rust/model.mustache | 3 +- .../src/models/create_state_request.rs | 3 +- .../custom_one_of_array_schema_inner.rs | 3 +- .../src/models/custom_one_of_schema.rs | 3 +- .../src/models/get_state_200_response.rs | 3 +- .../hyper/composed-oneof/src/models/obj_a.rs | 3 +- .../hyper/composed-oneof/src/models/obj_b.rs | 3 +- .../hyper/composed-oneof/src/models/obj_c.rs | 3 +- .../hyper/composed-oneof/src/models/obj_d.rs | 3 +- .../emptyObject/src/models/empty_object.rs | 3 +- .../hyper/oneOf-array-map/src/models/apple.rs | 3 +- .../hyper/oneOf-array-map/src/models/fruit.rs | 9 +++--- .../hyper/oneOf-array-map/src/models/grape.rs | 3 +- .../hyper/oneOf/src/models/addressable.rs | 3 +- .../rust/hyper/oneOf/src/models/apple.rs | 3 +- .../rust/hyper/oneOf/src/models/banana.rs | 3 +- .../others/rust/hyper/oneOf/src/models/bar.rs | 3 +- .../rust/hyper/oneOf/src/models/bar_create.rs | 3 +- .../rust/hyper/oneOf/src/models/bar_ref.rs | 3 +- .../oneOf/src/models/bar_ref_or_value.rs | 3 +- .../rust/hyper/oneOf/src/models/entity.rs | 3 +- .../rust/hyper/oneOf/src/models/entity_ref.rs | 3 +- .../rust/hyper/oneOf/src/models/extensible.rs | 3 +- .../others/rust/hyper/oneOf/src/models/foo.rs | 3 +- .../rust/hyper/oneOf/src/models/foo_ref.rs | 3 +- .../oneOf/src/models/foo_ref_or_value.rs | 3 +- .../rust/hyper/oneOf/src/models/fruit.rs | 3 +- .../rust/hyper/oneOf/src/models/fruit_type.rs | 3 +- .../rust/hyper/oneOf/src/models/pasta.rs | 3 +- .../rust/hyper/oneOf/src/models/pizza.rs | 3 +- .../hyper/oneOf/src/models/pizza_speziale.rs | 3 +- .../src/models/parent.rs | 3 +- .../src/models/create_state_request.rs | 3 +- .../custom_one_of_array_schema_inner.rs | 3 +- .../src/models/custom_one_of_schema.rs | 3 +- .../src/models/get_state_200_response.rs | 3 +- .../composed-oneof/src/models/obj_a.rs | 3 +- .../composed-oneof/src/models/obj_b.rs | 3 +- .../composed-oneof/src/models/obj_c.rs | 3 +- .../composed-oneof/src/models/obj_d.rs | 3 +- .../emptyObject/src/models/empty_object.rs | 3 +- .../oneOf-array-map/src/models/apple.rs | 3 +- .../oneOf-array-map/src/models/fruit.rs | 9 +++--- .../oneOf-array-map/src/models/grape.rs | 3 +- .../reqwest/oneOf/src/models/addressable.rs | 3 +- .../rust/reqwest/oneOf/src/models/apple.rs | 3 +- .../rust/reqwest/oneOf/src/models/banana.rs | 3 +- .../rust/reqwest/oneOf/src/models/bar.rs | 3 +- .../reqwest/oneOf/src/models/bar_create.rs | 3 +- .../rust/reqwest/oneOf/src/models/bar_ref.rs | 3 +- .../oneOf/src/models/bar_ref_or_value.rs | 3 +- .../rust/reqwest/oneOf/src/models/entity.rs | 3 +- .../reqwest/oneOf/src/models/entity_ref.rs | 3 +- .../reqwest/oneOf/src/models/extensible.rs | 3 +- .../rust/reqwest/oneOf/src/models/foo.rs | 3 +- .../rust/reqwest/oneOf/src/models/foo_ref.rs | 3 +- .../oneOf/src/models/foo_ref_or_value.rs | 3 +- .../rust/reqwest/oneOf/src/models/fruit.rs | 3 +- .../reqwest/oneOf/src/models/fruit_type.rs | 3 +- .../rust/reqwest/oneOf/src/models/pasta.rs | 3 +- .../rust/reqwest/oneOf/src/models/pizza.rs | 3 +- .../oneOf/src/models/pizza_speziale.rs | 3 +- .../hyper/petstore/docs/ActionContainer.md | 2 +- .../hyper/petstore/docs/ArrayItemRefTest.md | 4 +-- .../petstore/src/models/action_container.rs | 7 ++--- .../hyper/petstore/src/models/api_response.rs | 3 +- .../src/models/array_item_ref_test.rs | 9 +++--- .../rust/hyper/petstore/src/models/baz.rs | 3 +- .../hyper/petstore/src/models/category.rs | 3 +- .../petstore/src/models/enum_array_testing.rs | 3 +- .../hyper/petstore/src/models/model_return.rs | 3 +- .../petstore/src/models/nullable_array.rs | 3 +- .../petstore/src/models/optional_testing.rs | 3 +- .../rust/hyper/petstore/src/models/order.rs | 3 +- .../rust/hyper/petstore/src/models/pet.rs | 3 +- .../petstore/src/models/property_test.rs | 3 +- .../rust/hyper/petstore/src/models/tag.rs | 3 +- .../hyper/petstore/src/models/type_testing.rs | 3 +- .../src/models/unique_item_array_testing.rs | 3 +- .../rust/hyper/petstore/src/models/user.rs | 3 +- .../src/models/property_name_mapping.rs | 3 +- .../docs/ActionContainer.md | 2 +- .../docs/ArrayItemRefTest.md | 4 +-- .../src/models/action_container.rs | 7 ++--- .../src/models/api_response.rs | 3 +- .../src/models/array_item_ref_test.rs | 9 +++--- .../src/models/baz.rs | 3 +- .../src/models/category.rs | 3 +- .../src/models/enum_array_testing.rs | 3 +- .../src/models/model_return.rs | 3 +- .../src/models/nullable_array.rs | 3 +- .../src/models/optional_testing.rs | 3 +- .../src/models/order.rs | 3 +- .../src/models/pet.rs | 3 +- .../src/models/property_test.rs | 3 +- .../src/models/tag.rs | 3 +- .../src/models/type_testing.rs | 3 +- .../src/models/unique_item_array_testing.rs | 3 +- .../src/models/user.rs | 3 +- .../petstore-async/docs/ActionContainer.md | 2 +- .../petstore-async/docs/ArrayItemRefTest.md | 4 +-- .../src/models/action_container.rs | 7 ++--- .../petstore-async/src/models/api_response.rs | 3 +- .../src/models/array_item_ref_test.rs | 9 +++--- .../reqwest/petstore-async/src/models/baz.rs | 3 +- .../petstore-async/src/models/category.rs | 3 +- .../src/models/enum_array_testing.rs | 3 +- .../petstore-async/src/models/model_return.rs | 3 +- .../src/models/nullable_array.rs | 3 +- .../src/models/optional_testing.rs | 3 +- .../petstore-async/src/models/order.rs | 3 +- .../reqwest/petstore-async/src/models/pet.rs | 3 +- .../src/models/property_test.rs | 3 +- .../reqwest/petstore-async/src/models/tag.rs | 3 +- .../petstore-async/src/models/type_testing.rs | 3 +- .../src/models/unique_item_array_testing.rs | 3 +- .../reqwest/petstore-async/src/models/user.rs | 3 +- .../docs/ActionContainer.md | 2 +- .../docs/ArrayItemRefTest.md | 4 +-- .../src/models/action_container.rs | 7 ++--- .../src/models/api_response.rs | 3 +- .../src/models/array_item_ref_test.rs | 9 +++--- .../petstore-awsv4signature/src/models/baz.rs | 3 +- .../src/models/category.rs | 3 +- .../src/models/enum_array_testing.rs | 3 +- .../src/models/model_return.rs | 3 +- .../src/models/nullable_array.rs | 3 +- .../src/models/optional_testing.rs | 3 +- .../src/models/order.rs | 3 +- .../petstore-awsv4signature/src/models/pet.rs | 3 +- .../src/models/property_test.rs | 3 +- .../petstore-awsv4signature/src/models/tag.rs | 3 +- .../src/models/type_testing.rs | 3 +- .../src/models/unique_item_array_testing.rs | 3 +- .../src/models/user.rs | 3 +- .../reqwest/petstore/docs/ActionContainer.md | 2 +- .../reqwest/petstore/docs/ArrayItemRefTest.md | 4 +-- .../petstore/src/models/action_container.rs | 7 ++--- .../petstore/src/models/api_response.rs | 3 +- .../src/models/array_item_ref_test.rs | 9 +++--- .../rust/reqwest/petstore/src/models/baz.rs | 3 +- .../reqwest/petstore/src/models/category.rs | 3 +- .../petstore/src/models/enum_array_testing.rs | 3 +- .../petstore/src/models/model_return.rs | 3 +- .../petstore/src/models/nullable_array.rs | 3 +- .../petstore/src/models/optional_testing.rs | 3 +- .../rust/reqwest/petstore/src/models/order.rs | 3 +- .../rust/reqwest/petstore/src/models/pet.rs | 3 +- .../petstore/src/models/property_test.rs | 3 +- .../rust/reqwest/petstore/src/models/tag.rs | 3 +- .../petstore/src/models/type_testing.rs | 3 +- .../src/models/unique_item_array_testing.rs | 3 +- .../rust/reqwest/petstore/src/models/user.rs | 3 +- 155 files changed, 217 insertions(+), 342 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRustCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRustCodegen.java index 59ccdcd1c94d..2178c657ab36 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRustCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRustCodegen.java @@ -249,12 +249,8 @@ public String getTypeDeclaration(Schema p) { } else if (!org.apache.commons.lang3.StringUtils.isEmpty(p.get$ref())) { String datatype; try { - datatype = p.get$ref(); - - if (datatype.indexOf("#/components/schemas/") == 0) { - datatype = toModelName(datatype.substring("#/components/schemas/".length())); - datatype = "models::" + datatype; - } + datatype = toModelName(ModelUtils.getSimpleRef(p.get$ref())); + datatype = "models::" + datatype; } catch (Exception e) { LOGGER.warn("Error obtaining the datatype from schema (model):{}. Datatype default to Object", p); datatype = "Object"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java index 7135f5261789..b20f655467fa 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java @@ -230,14 +230,14 @@ public CodegenModel fromModel(String name, Schema model) { for (int i = 0; i < oneOfs.size(); i++) { CodegenProperty oneOf = oneOfs.get(i); Schema schema = schemas.get(i); - String aliasType = getTypeDeclaration(schema); - if (aliasType.startsWith("models::")) { - aliasType = aliasType.substring("models::".length()); + String aliasName = ModelUtils.getSimpleRef(schema.get$ref()); + if (aliasName != null) { + oneOf.setName(aliasName); } if (oneOf.getRef() != null) { oneOf.setBaseName(mappedNameByRef.get(oneOf.getRef())); } - oneOf.setName(aliasType); + } } @@ -437,6 +437,28 @@ public String modelDocFileFolder() { return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar); } + @Override + public String getTypeDeclaration(Schema p) { + Schema unaliasSchema = unaliasSchema(p); + String typeDeclaration = super.getTypeDeclaration(unaliasSchema); + + // Check if we need to UpperCamelize the type after super invocation + String schemaType = getSchemaType(unaliasSchema); + if (typeDeclaration.equals(schemaType)) { + if (typeMapping.containsValue(schemaType)) { + return schemaType; + } + + if (languageSpecificPrimitives.contains(schemaType)) { + return schemaType; + } + + typeDeclaration = "models::" + toModelName(schemaType); + } + + return typeDeclaration; + } + @Override public String getSchemaType(Schema p) { String schemaType = super.getSchemaType(p); diff --git a/modules/openapi-generator/src/main/resources/rust/model.mustache b/modules/openapi-generator/src/main/resources/rust/model.mustache index 4bb93ff6e967..6c5c9468aa0f 100644 --- a/modules/openapi-generator/src/main/resources/rust/model.mustache +++ b/modules/openapi-generator/src/main/resources/rust/model.mustache @@ -1,6 +1,5 @@ -use crate::models; - {{>partial_header}} +use crate::models; {{#models}} {{#model}} {{#description}} diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs index 751362a22d5d..9f7c5b26dcdb 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * oneOf test * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs index 255030da6686..25b8954b94be 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * oneOf test * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs index 0bddc69a829a..0806f0cfd235 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * oneOf test * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs index b87bf89b7627..033e98fc187f 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * oneOf test * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_a.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_a.rs index bfcbfb3028c8..f115991d7e25 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_a.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_a.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * oneOf test * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_b.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_b.rs index d905bb9722e3..58180b0d956c 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_b.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_b.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * oneOf test * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_c.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_c.rs index b550e8d8fa00..a5fb0d4cf90a 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_c.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_c.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * oneOf test * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_d.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_d.rs index f8cefe33c74b..47cbead2f248 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_d.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_d.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * oneOf test * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/hyper/emptyObject/src/models/empty_object.rs b/samples/client/others/rust/hyper/emptyObject/src/models/empty_object.rs index 06e27f51fcbc..7d16b214ac02 100644 --- a/samples/client/others/rust/hyper/emptyObject/src/models/empty_object.rs +++ b/samples/client/others/rust/hyper/emptyObject/src/models/empty_object.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * EmptyObject * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/models/apple.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/models/apple.rs index 2df6d0e08e59..f62be5152188 100644 --- a/samples/client/others/rust/hyper/oneOf-array-map/src/models/apple.rs +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/models/apple.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * fruity * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/models/fruit.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/models/fruit.rs index 2247f085851e..c3038084b6c3 100644 --- a/samples/client/others/rust/hyper/oneOf-array-map/src/models/fruit.rs +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/models/fruit.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * fruity * @@ -10,19 +8,20 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(untagged)] pub enum Fruit { - Apples(Box>), - Grapes(Box>), + apples(Box>), + grapes(Box>), } impl Default for Fruit { fn default() -> Self { - Self::Apples(Box::default()) + Self::apples(Box::default()) } } diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/models/grape.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/models/grape.rs index 86ead6847095..244eccf95701 100644 --- a/samples/client/others/rust/hyper/oneOf-array-map/src/models/grape.rs +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/models/grape.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * fruity * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/hyper/oneOf/src/models/addressable.rs b/samples/client/others/rust/hyper/oneOf/src/models/addressable.rs index d365468f53c0..b9e4efbc2c7e 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/addressable.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/addressable.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Addressable : Base schema for addressable entities diff --git a/samples/client/others/rust/hyper/oneOf/src/models/apple.rs b/samples/client/others/rust/hyper/oneOf/src/models/apple.rs index 6c17e35c43bd..bb38460ec471 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/apple.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/apple.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/hyper/oneOf/src/models/banana.rs b/samples/client/others/rust/hyper/oneOf/src/models/banana.rs index 61cbcfddce28..efc026edb86d 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/banana.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/banana.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/hyper/oneOf/src/models/bar.rs b/samples/client/others/rust/hyper/oneOf/src/models/bar.rs index 0a4b4d517171..3355f39c45c3 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/bar.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/bar.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/hyper/oneOf/src/models/bar_create.rs b/samples/client/others/rust/hyper/oneOf/src/models/bar_create.rs index 0c5a4120fa5d..9e9214758484 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/bar_create.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/bar_create.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/hyper/oneOf/src/models/bar_ref.rs b/samples/client/others/rust/hyper/oneOf/src/models/bar_ref.rs index fbd547e391e2..9a63c35dcee0 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/bar_ref.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/bar_ref.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/hyper/oneOf/src/models/bar_ref_or_value.rs b/samples/client/others/rust/hyper/oneOf/src/models/bar_ref_or_value.rs index 23325007ab20..01b5749df7e0 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/bar_ref_or_value.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/bar_ref_or_value.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/hyper/oneOf/src/models/entity.rs b/samples/client/others/rust/hyper/oneOf/src/models/entity.rs index ec82e1d11c35..6c7a23734df8 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/entity.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/entity.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/others/rust/hyper/oneOf/src/models/entity_ref.rs b/samples/client/others/rust/hyper/oneOf/src/models/entity_ref.rs index a4585a3e3ab9..1c6ad9b5fb12 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/entity_ref.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/entity_ref.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// EntityRef : Entity reference schema to be use for all entityRef class. diff --git a/samples/client/others/rust/hyper/oneOf/src/models/extensible.rs b/samples/client/others/rust/hyper/oneOf/src/models/extensible.rs index d3061ab36cc1..732c793beb2e 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/extensible.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/extensible.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/hyper/oneOf/src/models/foo.rs b/samples/client/others/rust/hyper/oneOf/src/models/foo.rs index 546608178e20..d920a5ff6fac 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/foo.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/foo.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/hyper/oneOf/src/models/foo_ref.rs b/samples/client/others/rust/hyper/oneOf/src/models/foo_ref.rs index bf47bf393c60..670254c03834 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/foo_ref.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/foo_ref.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs b/samples/client/others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs index 89ea309d569e..c3901be7133b 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs b/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs index 4f479ec09e90..23e19d97795a 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/others/rust/hyper/oneOf/src/models/fruit_type.rs b/samples/client/others/rust/hyper/oneOf/src/models/fruit_type.rs index b300d992a636..8e84d6064f19 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/fruit_type.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/fruit_type.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] diff --git a/samples/client/others/rust/hyper/oneOf/src/models/pasta.rs b/samples/client/others/rust/hyper/oneOf/src/models/pasta.rs index 36652331311b..9c9b98c5b15a 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/pasta.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/pasta.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/hyper/oneOf/src/models/pizza.rs b/samples/client/others/rust/hyper/oneOf/src/models/pizza.rs index fcf98581fbd6..ec55562e478b 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/pizza.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/pizza.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/hyper/oneOf/src/models/pizza_speziale.rs b/samples/client/others/rust/hyper/oneOf/src/models/pizza_speziale.rs index ff82c9a3bc5e..ad98d13c7937 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/pizza_speziale.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/pizza_speziale.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/reqwest-regression-16119/src/models/parent.rs b/samples/client/others/rust/reqwest-regression-16119/src/models/parent.rs index 972fd4c7412f..33dc7ddf02b6 100644 --- a/samples/client/others/rust/reqwest-regression-16119/src/models/parent.rs +++ b/samples/client/others/rust/reqwest-regression-16119/src/models/parent.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * double-option-hashmap * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs index 751362a22d5d..9f7c5b26dcdb 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * oneOf test * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs index 255030da6686..25b8954b94be 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * oneOf test * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs index 0bddc69a829a..0806f0cfd235 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * oneOf test * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs index b87bf89b7627..033e98fc187f 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * oneOf test * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_a.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_a.rs index bfcbfb3028c8..f115991d7e25 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_a.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_a.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * oneOf test * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_b.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_b.rs index d905bb9722e3..58180b0d956c 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_b.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_b.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * oneOf test * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_c.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_c.rs index b550e8d8fa00..a5fb0d4cf90a 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_c.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_c.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * oneOf test * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_d.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_d.rs index f8cefe33c74b..47cbead2f248 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_d.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_d.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * oneOf test * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/reqwest/emptyObject/src/models/empty_object.rs b/samples/client/others/rust/reqwest/emptyObject/src/models/empty_object.rs index 06e27f51fcbc..7d16b214ac02 100644 --- a/samples/client/others/rust/reqwest/emptyObject/src/models/empty_object.rs +++ b/samples/client/others/rust/reqwest/emptyObject/src/models/empty_object.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * EmptyObject * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/src/models/apple.rs b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/apple.rs index 2df6d0e08e59..f62be5152188 100644 --- a/samples/client/others/rust/reqwest/oneOf-array-map/src/models/apple.rs +++ b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/apple.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * fruity * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/src/models/fruit.rs b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/fruit.rs index 2247f085851e..c3038084b6c3 100644 --- a/samples/client/others/rust/reqwest/oneOf-array-map/src/models/fruit.rs +++ b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/fruit.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * fruity * @@ -10,19 +8,20 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(untagged)] pub enum Fruit { - Apples(Box>), - Grapes(Box>), + apples(Box>), + grapes(Box>), } impl Default for Fruit { fn default() -> Self { - Self::Apples(Box::default()) + Self::apples(Box::default()) } } diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/src/models/grape.rs b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/grape.rs index 86ead6847095..244eccf95701 100644 --- a/samples/client/others/rust/reqwest/oneOf-array-map/src/models/grape.rs +++ b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/grape.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * fruity * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/addressable.rs b/samples/client/others/rust/reqwest/oneOf/src/models/addressable.rs index d365468f53c0..b9e4efbc2c7e 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/addressable.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/addressable.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Addressable : Base schema for addressable entities diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/apple.rs b/samples/client/others/rust/reqwest/oneOf/src/models/apple.rs index 6c17e35c43bd..bb38460ec471 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/apple.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/apple.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/banana.rs b/samples/client/others/rust/reqwest/oneOf/src/models/banana.rs index 61cbcfddce28..efc026edb86d 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/banana.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/banana.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/bar.rs b/samples/client/others/rust/reqwest/oneOf/src/models/bar.rs index 0a4b4d517171..3355f39c45c3 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/bar.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/bar.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/bar_create.rs b/samples/client/others/rust/reqwest/oneOf/src/models/bar_create.rs index 0c5a4120fa5d..9e9214758484 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/bar_create.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/bar_create.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref.rs b/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref.rs index fbd547e391e2..9a63c35dcee0 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref_or_value.rs b/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref_or_value.rs index 23325007ab20..01b5749df7e0 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref_or_value.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref_or_value.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/entity.rs b/samples/client/others/rust/reqwest/oneOf/src/models/entity.rs index ec82e1d11c35..6c7a23734df8 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/entity.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/entity.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/entity_ref.rs b/samples/client/others/rust/reqwest/oneOf/src/models/entity_ref.rs index a4585a3e3ab9..1c6ad9b5fb12 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/entity_ref.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/entity_ref.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// EntityRef : Entity reference schema to be use for all entityRef class. diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/extensible.rs b/samples/client/others/rust/reqwest/oneOf/src/models/extensible.rs index d3061ab36cc1..732c793beb2e 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/extensible.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/extensible.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/foo.rs b/samples/client/others/rust/reqwest/oneOf/src/models/foo.rs index 546608178e20..d920a5ff6fac 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/foo.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/foo.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref.rs b/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref.rs index bf47bf393c60..670254c03834 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref_or_value.rs b/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref_or_value.rs index 89ea309d569e..c3901be7133b 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref_or_value.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref_or_value.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs b/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs index 4f479ec09e90..23e19d97795a 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/fruit_type.rs b/samples/client/others/rust/reqwest/oneOf/src/models/fruit_type.rs index b300d992a636..8e84d6064f19 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/fruit_type.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/fruit_type.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/pasta.rs b/samples/client/others/rust/reqwest/oneOf/src/models/pasta.rs index 36652331311b..9c9b98c5b15a 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/pasta.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/pasta.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/pizza.rs b/samples/client/others/rust/reqwest/oneOf/src/models/pizza.rs index fcf98581fbd6..ec55562e478b 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/pizza.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/pizza.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/pizza_speziale.rs b/samples/client/others/rust/reqwest/oneOf/src/models/pizza_speziale.rs index ff82c9a3bc5e..ad98d13c7937 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/pizza_speziale.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/pizza_speziale.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * ByRefOrValue * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/petstore/rust/hyper/petstore/docs/ActionContainer.md b/samples/client/petstore/rust/hyper/petstore/docs/ActionContainer.md index 0d690bd0c56f..4e0a0ba49615 100644 --- a/samples/client/petstore/rust/hyper/petstore/docs/ActionContainer.md +++ b/samples/client/petstore/rust/hyper/petstore/docs/ActionContainer.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | [**Baz**](Baz.md) | | +**action** | [**models::Baz**](Baz.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/hyper/petstore/docs/ArrayItemRefTest.md b/samples/client/petstore/rust/hyper/petstore/docs/ArrayItemRefTest.md index 2359c95a1866..616deda7c4b5 100644 --- a/samples/client/petstore/rust/hyper/petstore/docs/ArrayItemRefTest.md +++ b/samples/client/petstore/rust/hyper/petstore/docs/ArrayItemRefTest.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**list_with_array_ref** | [**Vec**](Vec.md) | | -**list_with_object_ref** | [**Vec**](std::collections::HashMap.md) | | +**list_with_array_ref** | [**Vec>**](Vec.md) | | +**list_with_object_ref** | [**Vec>**](std::collections::HashMap.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/action_container.rs b/samples/client/petstore/rust/hyper/petstore/src/models/action_container.rs index 20fcdf51c3fa..fea1f5eee3c6 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/action_container.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/action_container.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,17 +8,18 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ActionContainer { #[serde(rename = "action")] - pub action: Box, + pub action: Box, } impl ActionContainer { - pub fn new(action: Baz) -> ActionContainer { + pub fn new(action: models::Baz) -> ActionContainer { ActionContainer { action: Box::new(action), } diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/api_response.rs b/samples/client/petstore/rust/hyper/petstore/src/models/api_response.rs index 001383c97f18..1549ec2c4aab 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/api_response.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/api_response.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// ApiResponse : Describes the result of uploading an image resource diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/array_item_ref_test.rs b/samples/client/petstore/rust/hyper/petstore/src/models/array_item_ref_test.rs index 1a7d5f38a0b5..d02f0994d272 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/array_item_ref_test.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/array_item_ref_test.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// ArrayItemRefTest : Test handling of object reference in arrays @@ -17,14 +16,14 @@ use crate::models; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ArrayItemRefTest { #[serde(rename = "list_with_array_ref")] - pub list_with_array_ref: Vec, + pub list_with_array_ref: Vec>, #[serde(rename = "list_with_object_ref")] - pub list_with_object_ref: Vec, + pub list_with_object_ref: Vec>, } impl ArrayItemRefTest { /// Test handling of object reference in arrays - pub fn new(list_with_array_ref: Vec, list_with_object_ref: Vec) -> ArrayItemRefTest { + pub fn new(list_with_array_ref: Vec>, list_with_object_ref: Vec>) -> ArrayItemRefTest { ArrayItemRefTest { list_with_array_ref, list_with_object_ref, diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/baz.rs b/samples/client/petstore/rust/hyper/petstore/src/models/baz.rs index e572fe204124..83ce57798295 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/baz.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/baz.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Baz : Test handling of empty variants /// Test handling of empty variants diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/category.rs b/samples/client/petstore/rust/hyper/petstore/src/models/category.rs index 067aad5e54fd..04e4dcbbfaa1 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/category.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/category.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Category : A category for a pet diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/enum_array_testing.rs b/samples/client/petstore/rust/hyper/petstore/src/models/enum_array_testing.rs index 860f9d02dcf1..72e8250256f4 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/enum_array_testing.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/enum_array_testing.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// EnumArrayTesting : Test of enum array diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/model_return.rs b/samples/client/petstore/rust/hyper/petstore/src/models/model_return.rs index 45f12f85fec1..217798de6db8 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/model_return.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/model_return.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Return : Test using keywords diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/nullable_array.rs b/samples/client/petstore/rust/hyper/petstore/src/models/nullable_array.rs index aad44660b5dc..e21b8259a128 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/nullable_array.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/nullable_array.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/optional_testing.rs b/samples/client/petstore/rust/hyper/petstore/src/models/optional_testing.rs index 9f24111bd076..c546258b5aec 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/optional_testing.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/optional_testing.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// OptionalTesting : Test handling of optional and nullable fields diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/order.rs b/samples/client/petstore/rust/hyper/petstore/src/models/order.rs index 3e916b84b379..68bc1ffe42d3 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/order.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/order.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Order : An order for a pets from the pet store diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/pet.rs b/samples/client/petstore/rust/hyper/petstore/src/models/pet.rs index 6097058b792e..81b04f120f66 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/pet.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/pet.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Pet : A pet for sale in the pet store diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/property_test.rs b/samples/client/petstore/rust/hyper/petstore/src/models/property_test.rs index 330649729037..d058b5cd2285 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/property_test.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/property_test.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// PropertyTest : A model to test various formats, e.g. UUID diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/tag.rs b/samples/client/petstore/rust/hyper/petstore/src/models/tag.rs index d21f0aafd8e6..f42257d0bce7 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/tag.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/tag.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Tag : A tag for a pet diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/type_testing.rs b/samples/client/petstore/rust/hyper/petstore/src/models/type_testing.rs index 4f0a1819194b..f1f7c4171e27 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/type_testing.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/type_testing.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// TypeTesting : Test handling of different field data types diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/unique_item_array_testing.rs b/samples/client/petstore/rust/hyper/petstore/src/models/unique_item_array_testing.rs index 93efbd1aa241..16591be2f7ea 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/unique_item_array_testing.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/unique_item_array_testing.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// UniqueItemArrayTesting : Test handling of enum array with unique items diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/user.rs b/samples/client/petstore/rust/hyper/petstore/src/models/user.rs index f8153db61739..065e590b2c24 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/user.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/user.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// User : A User who is purchasing from the pet store diff --git a/samples/client/petstore/rust/reqwest/name-mapping/src/models/property_name_mapping.rs b/samples/client/petstore/rust/reqwest/name-mapping/src/models/property_name_mapping.rs index a61c9d7cc079..e64ebbe76c8a 100644 --- a/samples/client/petstore/rust/reqwest/name-mapping/src/models/property_name_mapping.rs +++ b/samples/client/petstore/rust/reqwest/name-mapping/src/models/property_name_mapping.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * rust test * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/ActionContainer.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/ActionContainer.md index 0d690bd0c56f..4e0a0ba49615 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/ActionContainer.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/ActionContainer.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | [**Baz**](Baz.md) | | +**action** | [**models::Baz**](Baz.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/ArrayItemRefTest.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/ArrayItemRefTest.md index 2359c95a1866..616deda7c4b5 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/ArrayItemRefTest.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/ArrayItemRefTest.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**list_with_array_ref** | [**Vec**](Vec.md) | | -**list_with_object_ref** | [**Vec**](std::collections::HashMap.md) | | +**list_with_array_ref** | [**Vec>**](Vec.md) | | +**list_with_object_ref** | [**Vec>**](std::collections::HashMap.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/action_container.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/action_container.rs index 20fcdf51c3fa..fea1f5eee3c6 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/action_container.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/action_container.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,17 +8,18 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ActionContainer { #[serde(rename = "action")] - pub action: Box, + pub action: Box, } impl ActionContainer { - pub fn new(action: Baz) -> ActionContainer { + pub fn new(action: models::Baz) -> ActionContainer { ActionContainer { action: Box::new(action), } diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/api_response.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/api_response.rs index 001383c97f18..1549ec2c4aab 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/api_response.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/api_response.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// ApiResponse : Describes the result of uploading an image resource diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/array_item_ref_test.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/array_item_ref_test.rs index 1a7d5f38a0b5..d02f0994d272 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/array_item_ref_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/array_item_ref_test.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// ArrayItemRefTest : Test handling of object reference in arrays @@ -17,14 +16,14 @@ use crate::models; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ArrayItemRefTest { #[serde(rename = "list_with_array_ref")] - pub list_with_array_ref: Vec, + pub list_with_array_ref: Vec>, #[serde(rename = "list_with_object_ref")] - pub list_with_object_ref: Vec, + pub list_with_object_ref: Vec>, } impl ArrayItemRefTest { /// Test handling of object reference in arrays - pub fn new(list_with_array_ref: Vec, list_with_object_ref: Vec) -> ArrayItemRefTest { + pub fn new(list_with_array_ref: Vec>, list_with_object_ref: Vec>) -> ArrayItemRefTest { ArrayItemRefTest { list_with_array_ref, list_with_object_ref, diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/baz.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/baz.rs index e572fe204124..83ce57798295 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/baz.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/baz.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Baz : Test handling of empty variants /// Test handling of empty variants diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/category.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/category.rs index 067aad5e54fd..04e4dcbbfaa1 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/category.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/category.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Category : A category for a pet diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/enum_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/enum_array_testing.rs index 860f9d02dcf1..72e8250256f4 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/enum_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/enum_array_testing.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// EnumArrayTesting : Test of enum array diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/model_return.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/model_return.rs index 45f12f85fec1..217798de6db8 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/model_return.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/model_return.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Return : Test using keywords diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/nullable_array.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/nullable_array.rs index aad44660b5dc..e21b8259a128 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/nullable_array.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/nullable_array.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/optional_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/optional_testing.rs index 9f24111bd076..c546258b5aec 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/optional_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/optional_testing.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// OptionalTesting : Test handling of optional and nullable fields diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/order.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/order.rs index 3e916b84b379..68bc1ffe42d3 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/order.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/order.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Order : An order for a pets from the pet store diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/pet.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/pet.rs index 6097058b792e..81b04f120f66 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/pet.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/pet.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Pet : A pet for sale in the pet store diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/property_test.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/property_test.rs index 330649729037..d058b5cd2285 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/property_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/property_test.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// PropertyTest : A model to test various formats, e.g. UUID diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/tag.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/tag.rs index d21f0aafd8e6..f42257d0bce7 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/tag.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/tag.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Tag : A tag for a pet diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/type_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/type_testing.rs index 4f0a1819194b..f1f7c4171e27 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/type_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/type_testing.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// TypeTesting : Test handling of different field data types diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/unique_item_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/unique_item_array_testing.rs index 93efbd1aa241..16591be2f7ea 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/unique_item_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/unique_item_array_testing.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// UniqueItemArrayTesting : Test handling of enum array with unique items diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/user.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/user.rs index f8153db61739..065e590b2c24 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/user.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/user.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// User : A User who is purchasing from the pet store diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/ActionContainer.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/ActionContainer.md index 0d690bd0c56f..4e0a0ba49615 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/ActionContainer.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/ActionContainer.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | [**Baz**](Baz.md) | | +**action** | [**models::Baz**](Baz.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/ArrayItemRefTest.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/ArrayItemRefTest.md index 2359c95a1866..616deda7c4b5 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/ArrayItemRefTest.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/ArrayItemRefTest.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**list_with_array_ref** | [**Vec**](Vec.md) | | -**list_with_object_ref** | [**Vec**](std::collections::HashMap.md) | | +**list_with_array_ref** | [**Vec>**](Vec.md) | | +**list_with_object_ref** | [**Vec>**](std::collections::HashMap.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/action_container.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/action_container.rs index 20fcdf51c3fa..fea1f5eee3c6 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/action_container.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/action_container.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,17 +8,18 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ActionContainer { #[serde(rename = "action")] - pub action: Box, + pub action: Box, } impl ActionContainer { - pub fn new(action: Baz) -> ActionContainer { + pub fn new(action: models::Baz) -> ActionContainer { ActionContainer { action: Box::new(action), } diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/api_response.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/api_response.rs index 001383c97f18..1549ec2c4aab 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/api_response.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/api_response.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// ApiResponse : Describes the result of uploading an image resource diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/array_item_ref_test.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/array_item_ref_test.rs index 1a7d5f38a0b5..d02f0994d272 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/array_item_ref_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/array_item_ref_test.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// ArrayItemRefTest : Test handling of object reference in arrays @@ -17,14 +16,14 @@ use crate::models; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ArrayItemRefTest { #[serde(rename = "list_with_array_ref")] - pub list_with_array_ref: Vec, + pub list_with_array_ref: Vec>, #[serde(rename = "list_with_object_ref")] - pub list_with_object_ref: Vec, + pub list_with_object_ref: Vec>, } impl ArrayItemRefTest { /// Test handling of object reference in arrays - pub fn new(list_with_array_ref: Vec, list_with_object_ref: Vec) -> ArrayItemRefTest { + pub fn new(list_with_array_ref: Vec>, list_with_object_ref: Vec>) -> ArrayItemRefTest { ArrayItemRefTest { list_with_array_ref, list_with_object_ref, diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/baz.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/baz.rs index e572fe204124..83ce57798295 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/baz.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/baz.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Baz : Test handling of empty variants /// Test handling of empty variants diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/category.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/category.rs index 067aad5e54fd..04e4dcbbfaa1 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/category.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/category.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Category : A category for a pet diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/enum_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/enum_array_testing.rs index 860f9d02dcf1..72e8250256f4 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/enum_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/enum_array_testing.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// EnumArrayTesting : Test of enum array diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/model_return.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/model_return.rs index 45f12f85fec1..217798de6db8 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/model_return.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/model_return.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Return : Test using keywords diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/nullable_array.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/nullable_array.rs index aad44660b5dc..e21b8259a128 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/nullable_array.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/nullable_array.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/optional_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/optional_testing.rs index 9f24111bd076..c546258b5aec 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/optional_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/optional_testing.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// OptionalTesting : Test handling of optional and nullable fields diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/order.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/order.rs index 3e916b84b379..68bc1ffe42d3 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/order.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/order.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Order : An order for a pets from the pet store diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/pet.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/pet.rs index 6097058b792e..81b04f120f66 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/pet.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/pet.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Pet : A pet for sale in the pet store diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/property_test.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/property_test.rs index 330649729037..d058b5cd2285 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/property_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/property_test.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// PropertyTest : A model to test various formats, e.g. UUID diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/tag.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/tag.rs index d21f0aafd8e6..f42257d0bce7 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/tag.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/tag.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Tag : A tag for a pet diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/type_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/type_testing.rs index 4f0a1819194b..f1f7c4171e27 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/type_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/type_testing.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// TypeTesting : Test handling of different field data types diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/unique_item_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/unique_item_array_testing.rs index 93efbd1aa241..16591be2f7ea 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/unique_item_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/unique_item_array_testing.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// UniqueItemArrayTesting : Test handling of enum array with unique items diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/user.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/user.rs index f8153db61739..065e590b2c24 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/user.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/user.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// User : A User who is purchasing from the pet store diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/ActionContainer.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/ActionContainer.md index 0d690bd0c56f..4e0a0ba49615 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/ActionContainer.md +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/ActionContainer.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | [**Baz**](Baz.md) | | +**action** | [**models::Baz**](Baz.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/ArrayItemRefTest.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/ArrayItemRefTest.md index 2359c95a1866..616deda7c4b5 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/ArrayItemRefTest.md +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/ArrayItemRefTest.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**list_with_array_ref** | [**Vec**](Vec.md) | | -**list_with_object_ref** | [**Vec**](std::collections::HashMap.md) | | +**list_with_array_ref** | [**Vec>**](Vec.md) | | +**list_with_object_ref** | [**Vec>**](std::collections::HashMap.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/action_container.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/action_container.rs index 20fcdf51c3fa..fea1f5eee3c6 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/action_container.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/action_container.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,17 +8,18 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ActionContainer { #[serde(rename = "action")] - pub action: Box, + pub action: Box, } impl ActionContainer { - pub fn new(action: Baz) -> ActionContainer { + pub fn new(action: models::Baz) -> ActionContainer { ActionContainer { action: Box::new(action), } diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/api_response.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/api_response.rs index 001383c97f18..1549ec2c4aab 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/api_response.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/api_response.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// ApiResponse : Describes the result of uploading an image resource diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/array_item_ref_test.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/array_item_ref_test.rs index 1a7d5f38a0b5..d02f0994d272 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/array_item_ref_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/array_item_ref_test.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// ArrayItemRefTest : Test handling of object reference in arrays @@ -17,14 +16,14 @@ use crate::models; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ArrayItemRefTest { #[serde(rename = "list_with_array_ref")] - pub list_with_array_ref: Vec, + pub list_with_array_ref: Vec>, #[serde(rename = "list_with_object_ref")] - pub list_with_object_ref: Vec, + pub list_with_object_ref: Vec>, } impl ArrayItemRefTest { /// Test handling of object reference in arrays - pub fn new(list_with_array_ref: Vec, list_with_object_ref: Vec) -> ArrayItemRefTest { + pub fn new(list_with_array_ref: Vec>, list_with_object_ref: Vec>) -> ArrayItemRefTest { ArrayItemRefTest { list_with_array_ref, list_with_object_ref, diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/baz.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/baz.rs index e572fe204124..83ce57798295 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/baz.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/baz.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Baz : Test handling of empty variants /// Test handling of empty variants diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/category.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/category.rs index 067aad5e54fd..04e4dcbbfaa1 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/category.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/category.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Category : A category for a pet diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/enum_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/enum_array_testing.rs index 860f9d02dcf1..72e8250256f4 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/enum_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/enum_array_testing.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// EnumArrayTesting : Test of enum array diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/model_return.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/model_return.rs index 45f12f85fec1..217798de6db8 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/model_return.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/model_return.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Return : Test using keywords diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/nullable_array.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/nullable_array.rs index aad44660b5dc..e21b8259a128 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/nullable_array.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/nullable_array.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/optional_testing.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/optional_testing.rs index 9f24111bd076..c546258b5aec 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/optional_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/optional_testing.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// OptionalTesting : Test handling of optional and nullable fields diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/order.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/order.rs index 3e916b84b379..68bc1ffe42d3 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/order.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/order.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Order : An order for a pets from the pet store diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/pet.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/pet.rs index 6097058b792e..81b04f120f66 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/pet.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/pet.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Pet : A pet for sale in the pet store diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/property_test.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/property_test.rs index 330649729037..d058b5cd2285 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/property_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/property_test.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// PropertyTest : A model to test various formats, e.g. UUID diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/tag.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/tag.rs index d21f0aafd8e6..f42257d0bce7 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/tag.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/tag.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Tag : A tag for a pet diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/type_testing.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/type_testing.rs index 4f0a1819194b..f1f7c4171e27 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/type_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/type_testing.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// TypeTesting : Test handling of different field data types diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/unique_item_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/unique_item_array_testing.rs index 93efbd1aa241..16591be2f7ea 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/unique_item_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/unique_item_array_testing.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// UniqueItemArrayTesting : Test handling of enum array with unique items diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/user.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/user.rs index f8153db61739..065e590b2c24 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/user.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/user.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// User : A User who is purchasing from the pet store diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/ActionContainer.md b/samples/client/petstore/rust/reqwest/petstore/docs/ActionContainer.md index 0d690bd0c56f..4e0a0ba49615 100644 --- a/samples/client/petstore/rust/reqwest/petstore/docs/ActionContainer.md +++ b/samples/client/petstore/rust/reqwest/petstore/docs/ActionContainer.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**action** | [**Baz**](Baz.md) | | +**action** | [**models::Baz**](Baz.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/ArrayItemRefTest.md b/samples/client/petstore/rust/reqwest/petstore/docs/ArrayItemRefTest.md index 2359c95a1866..616deda7c4b5 100644 --- a/samples/client/petstore/rust/reqwest/petstore/docs/ArrayItemRefTest.md +++ b/samples/client/petstore/rust/reqwest/petstore/docs/ArrayItemRefTest.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**list_with_array_ref** | [**Vec**](Vec.md) | | -**list_with_object_ref** | [**Vec**](std::collections::HashMap.md) | | +**list_with_array_ref** | [**Vec>**](Vec.md) | | +**list_with_object_ref** | [**Vec>**](std::collections::HashMap.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/action_container.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/action_container.rs index 20fcdf51c3fa..fea1f5eee3c6 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/action_container.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/action_container.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,17 +8,18 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ActionContainer { #[serde(rename = "action")] - pub action: Box, + pub action: Box, } impl ActionContainer { - pub fn new(action: Baz) -> ActionContainer { + pub fn new(action: models::Baz) -> ActionContainer { ActionContainer { action: Box::new(action), } diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/api_response.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/api_response.rs index 001383c97f18..1549ec2c4aab 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/api_response.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/api_response.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// ApiResponse : Describes the result of uploading an image resource diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/array_item_ref_test.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/array_item_ref_test.rs index 1a7d5f38a0b5..d02f0994d272 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/array_item_ref_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/array_item_ref_test.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// ArrayItemRefTest : Test handling of object reference in arrays @@ -17,14 +16,14 @@ use crate::models; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ArrayItemRefTest { #[serde(rename = "list_with_array_ref")] - pub list_with_array_ref: Vec, + pub list_with_array_ref: Vec>, #[serde(rename = "list_with_object_ref")] - pub list_with_object_ref: Vec, + pub list_with_object_ref: Vec>, } impl ArrayItemRefTest { /// Test handling of object reference in arrays - pub fn new(list_with_array_ref: Vec, list_with_object_ref: Vec) -> ArrayItemRefTest { + pub fn new(list_with_array_ref: Vec>, list_with_object_ref: Vec>) -> ArrayItemRefTest { ArrayItemRefTest { list_with_array_ref, list_with_object_ref, diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/baz.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/baz.rs index e572fe204124..83ce57798295 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/baz.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/baz.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Baz : Test handling of empty variants /// Test handling of empty variants diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/category.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/category.rs index 067aad5e54fd..04e4dcbbfaa1 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/category.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/category.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Category : A category for a pet diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/enum_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/enum_array_testing.rs index 860f9d02dcf1..72e8250256f4 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/enum_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/enum_array_testing.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// EnumArrayTesting : Test of enum array diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/model_return.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/model_return.rs index 45f12f85fec1..217798de6db8 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/model_return.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/model_return.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Return : Test using keywords diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/nullable_array.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/nullable_array.rs index aad44660b5dc..e21b8259a128 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/nullable_array.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/nullable_array.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/optional_testing.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/optional_testing.rs index 9f24111bd076..c546258b5aec 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/optional_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/optional_testing.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// OptionalTesting : Test handling of optional and nullable fields diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/order.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/order.rs index 8774db8d4e94..df13ede614d0 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/order.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/order.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Order : An order for a pets from the pet store diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs index 6097058b792e..81b04f120f66 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Pet : A pet for sale in the pet store diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/property_test.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/property_test.rs index 330649729037..d058b5cd2285 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/property_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/property_test.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// PropertyTest : A model to test various formats, e.g. UUID diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/tag.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/tag.rs index d21f0aafd8e6..f42257d0bce7 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/tag.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/tag.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// Tag : A tag for a pet diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/type_testing.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/type_testing.rs index 4f0a1819194b..f1f7c4171e27 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/type_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/type_testing.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// TypeTesting : Test handling of different field data types diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/unique_item_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/unique_item_array_testing.rs index 93efbd1aa241..16591be2f7ea 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/unique_item_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/unique_item_array_testing.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// UniqueItemArrayTesting : Test handling of enum array with unique items diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/user.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/user.rs index f8153db61739..065e590b2c24 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/user.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/user.rs @@ -1,5 +1,3 @@ -use crate::models; - /* * OpenAPI Petstore * @@ -10,6 +8,7 @@ use crate::models; * Generated by: https://openapi-generator.tech */ +use crate::models; /// User : A User who is purchasing from the pet store From ff92e44f73d78ed390b9c0ef56d4ab3cca546a67 Mon Sep 17 00:00:00 2001 From: Artem Medvedev Date: Wed, 21 Feb 2024 14:34:57 +0100 Subject: [PATCH 06/13] style: improve indentation for models --- .../openapi-generator/src/main/resources/rust/model.mustache | 5 +---- .../hyper/composed-oneof/src/models/create_state_request.rs | 3 --- .../src/models/custom_one_of_array_schema_inner.rs | 3 --- .../hyper/composed-oneof/src/models/custom_one_of_schema.rs | 3 --- .../composed-oneof/src/models/get_state_200_response.rs | 3 --- .../others/rust/hyper/composed-oneof/src/models/obj_a.rs | 3 --- .../others/rust/hyper/composed-oneof/src/models/obj_b.rs | 3 --- .../others/rust/hyper/composed-oneof/src/models/obj_c.rs | 3 --- .../others/rust/hyper/composed-oneof/src/models/obj_d.rs | 3 --- .../others/rust/hyper/emptyObject/src/models/empty_object.rs | 3 --- .../others/rust/hyper/oneOf-array-map/src/models/apple.rs | 3 --- .../others/rust/hyper/oneOf-array-map/src/models/fruit.rs | 3 --- .../others/rust/hyper/oneOf-array-map/src/models/grape.rs | 3 --- .../client/others/rust/hyper/oneOf/src/models/addressable.rs | 5 +---- samples/client/others/rust/hyper/oneOf/src/models/apple.rs | 3 --- samples/client/others/rust/hyper/oneOf/src/models/banana.rs | 3 --- samples/client/others/rust/hyper/oneOf/src/models/bar.rs | 3 --- .../client/others/rust/hyper/oneOf/src/models/bar_create.rs | 3 --- samples/client/others/rust/hyper/oneOf/src/models/bar_ref.rs | 3 --- .../others/rust/hyper/oneOf/src/models/bar_ref_or_value.rs | 3 --- samples/client/others/rust/hyper/oneOf/src/models/entity.rs | 3 --- .../client/others/rust/hyper/oneOf/src/models/entity_ref.rs | 5 +---- .../client/others/rust/hyper/oneOf/src/models/extensible.rs | 3 --- samples/client/others/rust/hyper/oneOf/src/models/foo.rs | 3 --- samples/client/others/rust/hyper/oneOf/src/models/foo_ref.rs | 3 --- .../others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs | 3 --- samples/client/others/rust/hyper/oneOf/src/models/fruit.rs | 3 --- .../client/others/rust/hyper/oneOf/src/models/fruit_type.rs | 3 --- samples/client/others/rust/hyper/oneOf/src/models/pasta.rs | 3 --- samples/client/others/rust/hyper/oneOf/src/models/pizza.rs | 3 --- .../others/rust/hyper/oneOf/src/models/pizza_speziale.rs | 3 --- .../rust/reqwest-regression-16119/src/models/parent.rs | 3 --- .../composed-oneof/src/models/create_state_request.rs | 3 --- .../src/models/custom_one_of_array_schema_inner.rs | 3 --- .../composed-oneof/src/models/custom_one_of_schema.rs | 3 --- .../composed-oneof/src/models/get_state_200_response.rs | 3 --- .../others/rust/reqwest/composed-oneof/src/models/obj_a.rs | 3 --- .../others/rust/reqwest/composed-oneof/src/models/obj_b.rs | 3 --- .../others/rust/reqwest/composed-oneof/src/models/obj_c.rs | 3 --- .../others/rust/reqwest/composed-oneof/src/models/obj_d.rs | 3 --- .../rust/reqwest/emptyObject/src/models/empty_object.rs | 3 --- .../others/rust/reqwest/oneOf-array-map/src/models/apple.rs | 3 --- .../others/rust/reqwest/oneOf-array-map/src/models/fruit.rs | 3 --- .../others/rust/reqwest/oneOf-array-map/src/models/grape.rs | 3 --- .../others/rust/reqwest/oneOf/src/models/addressable.rs | 5 +---- samples/client/others/rust/reqwest/oneOf/src/models/apple.rs | 3 --- .../client/others/rust/reqwest/oneOf/src/models/banana.rs | 3 --- samples/client/others/rust/reqwest/oneOf/src/models/bar.rs | 3 --- .../others/rust/reqwest/oneOf/src/models/bar_create.rs | 3 --- .../client/others/rust/reqwest/oneOf/src/models/bar_ref.rs | 3 --- .../others/rust/reqwest/oneOf/src/models/bar_ref_or_value.rs | 3 --- .../client/others/rust/reqwest/oneOf/src/models/entity.rs | 3 --- .../others/rust/reqwest/oneOf/src/models/entity_ref.rs | 5 +---- .../others/rust/reqwest/oneOf/src/models/extensible.rs | 3 --- samples/client/others/rust/reqwest/oneOf/src/models/foo.rs | 3 --- .../client/others/rust/reqwest/oneOf/src/models/foo_ref.rs | 3 --- .../others/rust/reqwest/oneOf/src/models/foo_ref_or_value.rs | 3 --- samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs | 3 --- .../others/rust/reqwest/oneOf/src/models/fruit_type.rs | 3 --- samples/client/others/rust/reqwest/oneOf/src/models/pasta.rs | 3 --- samples/client/others/rust/reqwest/oneOf/src/models/pizza.rs | 3 --- .../others/rust/reqwest/oneOf/src/models/pizza_speziale.rs | 3 --- .../rust/hyper/petstore/src/models/action_container.rs | 3 --- .../petstore/rust/hyper/petstore/src/models/api_response.rs | 5 +---- .../rust/hyper/petstore/src/models/array_item_ref_test.rs | 5 +---- .../client/petstore/rust/hyper/petstore/src/models/baz.rs | 5 +---- .../petstore/rust/hyper/petstore/src/models/category.rs | 5 +---- .../rust/hyper/petstore/src/models/enum_array_testing.rs | 5 +---- .../petstore/rust/hyper/petstore/src/models/model_return.rs | 5 +---- .../rust/hyper/petstore/src/models/nullable_array.rs | 3 --- .../rust/hyper/petstore/src/models/optional_testing.rs | 5 +---- .../client/petstore/rust/hyper/petstore/src/models/order.rs | 5 +---- .../client/petstore/rust/hyper/petstore/src/models/pet.rs | 5 +---- .../petstore/rust/hyper/petstore/src/models/property_test.rs | 5 +---- .../client/petstore/rust/hyper/petstore/src/models/tag.rs | 5 +---- .../petstore/rust/hyper/petstore/src/models/type_testing.rs | 5 +---- .../hyper/petstore/src/models/unique_item_array_testing.rs | 5 +---- .../client/petstore/rust/hyper/petstore/src/models/user.rs | 5 +---- .../reqwest/name-mapping/src/models/property_name_mapping.rs | 3 --- .../petstore-async-middleware/src/models/action_container.rs | 3 --- .../petstore-async-middleware/src/models/api_response.rs | 5 +---- .../src/models/array_item_ref_test.rs | 5 +---- .../rust/reqwest/petstore-async-middleware/src/models/baz.rs | 5 +---- .../reqwest/petstore-async-middleware/src/models/category.rs | 5 +---- .../src/models/enum_array_testing.rs | 5 +---- .../petstore-async-middleware/src/models/model_return.rs | 5 +---- .../petstore-async-middleware/src/models/nullable_array.rs | 3 --- .../petstore-async-middleware/src/models/optional_testing.rs | 5 +---- .../reqwest/petstore-async-middleware/src/models/order.rs | 5 +---- .../rust/reqwest/petstore-async-middleware/src/models/pet.rs | 5 +---- .../petstore-async-middleware/src/models/property_test.rs | 5 +---- .../rust/reqwest/petstore-async-middleware/src/models/tag.rs | 5 +---- .../petstore-async-middleware/src/models/type_testing.rs | 5 +---- .../src/models/unique_item_array_testing.rs | 5 +---- .../reqwest/petstore-async-middleware/src/models/user.rs | 5 +---- .../reqwest/petstore-async/src/models/action_container.rs | 3 --- .../rust/reqwest/petstore-async/src/models/api_response.rs | 5 +---- .../reqwest/petstore-async/src/models/array_item_ref_test.rs | 5 +---- .../petstore/rust/reqwest/petstore-async/src/models/baz.rs | 5 +---- .../rust/reqwest/petstore-async/src/models/category.rs | 5 +---- .../reqwest/petstore-async/src/models/enum_array_testing.rs | 5 +---- .../rust/reqwest/petstore-async/src/models/model_return.rs | 5 +---- .../rust/reqwest/petstore-async/src/models/nullable_array.rs | 3 --- .../reqwest/petstore-async/src/models/optional_testing.rs | 5 +---- .../petstore/rust/reqwest/petstore-async/src/models/order.rs | 5 +---- .../petstore/rust/reqwest/petstore-async/src/models/pet.rs | 5 +---- .../rust/reqwest/petstore-async/src/models/property_test.rs | 5 +---- .../petstore/rust/reqwest/petstore-async/src/models/tag.rs | 5 +---- .../rust/reqwest/petstore-async/src/models/type_testing.rs | 5 +---- .../petstore-async/src/models/unique_item_array_testing.rs | 5 +---- .../petstore/rust/reqwest/petstore-async/src/models/user.rs | 5 +---- .../petstore-awsv4signature/src/models/action_container.rs | 3 --- .../petstore-awsv4signature/src/models/api_response.rs | 5 +---- .../src/models/array_item_ref_test.rs | 5 +---- .../rust/reqwest/petstore-awsv4signature/src/models/baz.rs | 5 +---- .../reqwest/petstore-awsv4signature/src/models/category.rs | 5 +---- .../petstore-awsv4signature/src/models/enum_array_testing.rs | 5 +---- .../petstore-awsv4signature/src/models/model_return.rs | 5 +---- .../petstore-awsv4signature/src/models/nullable_array.rs | 3 --- .../petstore-awsv4signature/src/models/optional_testing.rs | 5 +---- .../rust/reqwest/petstore-awsv4signature/src/models/order.rs | 5 +---- .../rust/reqwest/petstore-awsv4signature/src/models/pet.rs | 5 +---- .../petstore-awsv4signature/src/models/property_test.rs | 5 +---- .../rust/reqwest/petstore-awsv4signature/src/models/tag.rs | 5 +---- .../petstore-awsv4signature/src/models/type_testing.rs | 5 +---- .../src/models/unique_item_array_testing.rs | 5 +---- .../rust/reqwest/petstore-awsv4signature/src/models/user.rs | 5 +---- .../rust/reqwest/petstore/src/models/action_container.rs | 3 --- .../rust/reqwest/petstore/src/models/api_response.rs | 5 +---- .../rust/reqwest/petstore/src/models/array_item_ref_test.rs | 5 +---- .../client/petstore/rust/reqwest/petstore/src/models/baz.rs | 5 +---- .../petstore/rust/reqwest/petstore/src/models/category.rs | 5 +---- .../rust/reqwest/petstore/src/models/enum_array_testing.rs | 5 +---- .../rust/reqwest/petstore/src/models/model_return.rs | 5 +---- .../rust/reqwest/petstore/src/models/nullable_array.rs | 3 --- .../rust/reqwest/petstore/src/models/optional_testing.rs | 5 +---- .../petstore/rust/reqwest/petstore/src/models/order.rs | 5 +---- .../client/petstore/rust/reqwest/petstore/src/models/pet.rs | 5 +---- .../rust/reqwest/petstore/src/models/property_test.rs | 5 +---- .../client/petstore/rust/reqwest/petstore/src/models/tag.rs | 5 +---- .../rust/reqwest/petstore/src/models/type_testing.rs | 5 +---- .../reqwest/petstore/src/models/unique_item_array_testing.rs | 5 +---- .../client/petstore/rust/reqwest/petstore/src/models/user.rs | 5 +---- 143 files changed, 75 insertions(+), 504 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/rust/model.mustache b/modules/openapi-generator/src/main/resources/rust/model.mustache index 6c5c9468aa0f..f00d63a5af7a 100644 --- a/modules/openapi-generator/src/main/resources/rust/model.mustache +++ b/modules/openapi-generator/src/main/resources/rust/model.mustache @@ -2,10 +2,10 @@ use crate::models; {{#models}} {{#model}} + {{#description}} /// {{{classname}}} : {{{description}}} {{/description}} - {{!-- for enum schemas --}} {{#isEnum}} /// {{{description}}} @@ -38,7 +38,6 @@ impl Default for {{{classname}}} { } } {{/isEnum}} - {{!-- for schemas that have a discriminator --}} {{#discriminator}} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -83,7 +82,6 @@ impl Default for {{classname}} { } {{/discriminator}} - {{!-- for non-enum schemas --}} {{^isEnum}} {{^discriminator}} @@ -136,7 +134,6 @@ impl Default for {{classname}} { {{/oneOf.isEmpty}} {{/discriminator}} {{/isEnum}} - {{!-- for properties that are of enum type --}} {{#vars}} {{#isEnum}} diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs index 9f7c5b26dcdb..8d7300058a44 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs @@ -10,7 +10,6 @@ use crate::models; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "realtype")] pub enum CreateStateRequest { @@ -27,5 +26,3 @@ impl Default for CreateStateRequest { } - - diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs index 25b8954b94be..2b424a07b764 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs @@ -10,7 +10,6 @@ use crate::models; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "realtype")] pub enum CustomOneOfArraySchemaInner { @@ -29,5 +28,3 @@ impl Default for CustomOneOfArraySchemaInner { } - - diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs index 0806f0cfd235..fd9844a8e2d0 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs @@ -10,7 +10,6 @@ use crate::models; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "realtype")] pub enum CustomOneOfSchema { @@ -27,5 +26,3 @@ impl Default for CustomOneOfSchema { } - - diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs index 033e98fc187f..94b4d6686368 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs @@ -10,7 +10,6 @@ use crate::models; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "realtype")] pub enum GetState200Response { @@ -29,5 +28,3 @@ impl Default for GetState200Response { } - - diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_a.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_a.rs index f115991d7e25..67e72b00fed4 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_a.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_a.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ObjA { #[serde(rename = "realtype", skip_serializing_if = "Option::is_none")] @@ -29,4 +27,3 @@ impl ObjA { } } - diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_b.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_b.rs index 58180b0d956c..835695c76619 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_b.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_b.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ObjB { #[serde(rename = "realtype", skip_serializing_if = "Option::is_none")] @@ -32,4 +30,3 @@ impl ObjB { } } - diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_c.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_c.rs index a5fb0d4cf90a..abc6aae24870 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_c.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_c.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ObjC { #[serde(rename = "realtype", skip_serializing_if = "Option::is_none")] @@ -29,4 +27,3 @@ impl ObjC { } } - diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_d.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_d.rs index 47cbead2f248..287c2f24e3e9 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_d.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_d.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ObjD { #[serde(rename = "realtype", skip_serializing_if = "Option::is_none")] @@ -29,4 +27,3 @@ impl ObjD { } } - diff --git a/samples/client/others/rust/hyper/emptyObject/src/models/empty_object.rs b/samples/client/others/rust/hyper/emptyObject/src/models/empty_object.rs index 7d16b214ac02..6db5fbff7ad2 100644 --- a/samples/client/others/rust/hyper/emptyObject/src/models/empty_object.rs +++ b/samples/client/others/rust/hyper/emptyObject/src/models/empty_object.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct EmptyObject { #[serde(rename = "emptyObject", skip_serializing_if = "Option::is_none")] @@ -26,4 +24,3 @@ impl EmptyObject { } } - diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/models/apple.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/models/apple.rs index f62be5152188..8472b2a8e5a0 100644 --- a/samples/client/others/rust/hyper/oneOf-array-map/src/models/apple.rs +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/models/apple.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Apple { #[serde(rename = "kind", skip_serializing_if = "Option::is_none")] @@ -26,4 +24,3 @@ impl Apple { } } - diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/models/fruit.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/models/fruit.rs index c3038084b6c3..ee270a67041f 100644 --- a/samples/client/others/rust/hyper/oneOf-array-map/src/models/fruit.rs +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/models/fruit.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(untagged)] pub enum Fruit { @@ -25,4 +23,3 @@ impl Default for Fruit { } } - diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/models/grape.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/models/grape.rs index 244eccf95701..bc7d12681c4e 100644 --- a/samples/client/others/rust/hyper/oneOf-array-map/src/models/grape.rs +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/models/grape.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Grape { #[serde(rename = "color", skip_serializing_if = "Option::is_none")] @@ -26,4 +24,3 @@ impl Grape { } } - diff --git a/samples/client/others/rust/hyper/oneOf/src/models/addressable.rs b/samples/client/others/rust/hyper/oneOf/src/models/addressable.rs index b9e4efbc2c7e..82d62ccc2883 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/addressable.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/addressable.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Addressable : Base schema for addressable entities - - +/// Addressable : Base schema for addressable entities #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Addressable { /// Hyperlink reference @@ -33,4 +31,3 @@ impl Addressable { } } - diff --git a/samples/client/others/rust/hyper/oneOf/src/models/apple.rs b/samples/client/others/rust/hyper/oneOf/src/models/apple.rs index bb38460ec471..54b954846718 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/apple.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/apple.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Apple { #[serde(rename = "seeds")] @@ -26,4 +24,3 @@ impl Apple { } } - diff --git a/samples/client/others/rust/hyper/oneOf/src/models/banana.rs b/samples/client/others/rust/hyper/oneOf/src/models/banana.rs index efc026edb86d..d026dbd2b8e5 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/banana.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/banana.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Banana { #[serde(rename = "length")] @@ -26,4 +24,3 @@ impl Banana { } } - diff --git a/samples/client/others/rust/hyper/oneOf/src/models/bar.rs b/samples/client/others/rust/hyper/oneOf/src/models/bar.rs index 3355f39c45c3..7508b00b9af5 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/bar.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/bar.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Bar { #[serde(rename = "id")] @@ -51,4 +49,3 @@ impl Bar { } } - diff --git a/samples/client/others/rust/hyper/oneOf/src/models/bar_create.rs b/samples/client/others/rust/hyper/oneOf/src/models/bar_create.rs index 9e9214758484..0afc67998fe4 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/bar_create.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/bar_create.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct BarCreate { #[serde(rename = "barPropA", skip_serializing_if = "Option::is_none")] @@ -52,4 +50,3 @@ impl BarCreate { } } - diff --git a/samples/client/others/rust/hyper/oneOf/src/models/bar_ref.rs b/samples/client/others/rust/hyper/oneOf/src/models/bar_ref.rs index 9a63c35dcee0..42e2176fca0b 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/bar_ref.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/bar_ref.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct BarRef { /// Name of the related entity. @@ -51,4 +49,3 @@ impl BarRef { } } - diff --git a/samples/client/others/rust/hyper/oneOf/src/models/bar_ref_or_value.rs b/samples/client/others/rust/hyper/oneOf/src/models/bar_ref_or_value.rs index 01b5749df7e0..61c3f57a4507 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/bar_ref_or_value.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/bar_ref_or_value.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(untagged)] pub enum BarRefOrValue { @@ -25,4 +23,3 @@ impl Default for BarRefOrValue { } } - diff --git a/samples/client/others/rust/hyper/oneOf/src/models/entity.rs b/samples/client/others/rust/hyper/oneOf/src/models/entity.rs index 6c7a23734df8..b864cab686e0 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/entity.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/entity.rs @@ -10,7 +10,6 @@ use crate::models; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "@type")] pub enum Entity { @@ -119,5 +118,3 @@ impl Default for Entity { } - - diff --git a/samples/client/others/rust/hyper/oneOf/src/models/entity_ref.rs b/samples/client/others/rust/hyper/oneOf/src/models/entity_ref.rs index 1c6ad9b5fb12..60773f6e9afb 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/entity_ref.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/entity_ref.rs @@ -9,9 +9,8 @@ */ use crate::models; -/// EntityRef : Entity reference schema to be use for all entityRef class. - +/// EntityRef : Entity reference schema to be use for all entityRef class. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "@type")] pub enum EntityRef { @@ -74,5 +73,3 @@ impl Default for EntityRef { } - - diff --git a/samples/client/others/rust/hyper/oneOf/src/models/extensible.rs b/samples/client/others/rust/hyper/oneOf/src/models/extensible.rs index 732c793beb2e..d87abf5be19a 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/extensible.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/extensible.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Extensible { /// A URI to a JSON-Schema file that defines additional attributes and relationships @@ -35,4 +33,3 @@ impl Extensible { } } - diff --git a/samples/client/others/rust/hyper/oneOf/src/models/foo.rs b/samples/client/others/rust/hyper/oneOf/src/models/foo.rs index d920a5ff6fac..be82765a3a89 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/foo.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/foo.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Foo { #[serde(rename = "fooPropA", skip_serializing_if = "Option::is_none")] @@ -49,4 +47,3 @@ impl Foo { } } - diff --git a/samples/client/others/rust/hyper/oneOf/src/models/foo_ref.rs b/samples/client/others/rust/hyper/oneOf/src/models/foo_ref.rs index 670254c03834..11640d85a7ca 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/foo_ref.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/foo_ref.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct FooRef { #[serde(rename = "foorefPropA", skip_serializing_if = "Option::is_none")] @@ -54,4 +52,3 @@ impl FooRef { } } - diff --git a/samples/client/others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs b/samples/client/others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs index c3901be7133b..e06ca7c1ffff 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs @@ -10,7 +10,6 @@ use crate::models; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "@type")] pub enum FooRefOrValue { @@ -25,5 +24,3 @@ impl Default for FooRefOrValue { } - - diff --git a/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs b/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs index 23e19d97795a..ef068172592e 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs @@ -10,7 +10,6 @@ use crate::models; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "fruitType")] pub enum Fruit { @@ -27,5 +26,3 @@ impl Default for Fruit { } - - diff --git a/samples/client/others/rust/hyper/oneOf/src/models/fruit_type.rs b/samples/client/others/rust/hyper/oneOf/src/models/fruit_type.rs index 8e84d6064f19..00f405a7846a 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/fruit_type.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/fruit_type.rs @@ -35,6 +35,3 @@ impl Default for FruitType { } } - - - diff --git a/samples/client/others/rust/hyper/oneOf/src/models/pasta.rs b/samples/client/others/rust/hyper/oneOf/src/models/pasta.rs index 9c9b98c5b15a..69ae5110cf6d 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/pasta.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/pasta.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Pasta { #[serde(rename = "vendor", skip_serializing_if = "Option::is_none")] @@ -46,4 +44,3 @@ impl Pasta { } } - diff --git a/samples/client/others/rust/hyper/oneOf/src/models/pizza.rs b/samples/client/others/rust/hyper/oneOf/src/models/pizza.rs index ec55562e478b..6ae7f457df41 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/pizza.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/pizza.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Pizza { #[serde(rename = "pizzaSize", skip_serializing_if = "Option::is_none")] @@ -46,4 +44,3 @@ impl Pizza { } } - diff --git a/samples/client/others/rust/hyper/oneOf/src/models/pizza_speziale.rs b/samples/client/others/rust/hyper/oneOf/src/models/pizza_speziale.rs index ad98d13c7937..e1c5258c616d 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/pizza_speziale.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/pizza_speziale.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct PizzaSpeziale { #[serde(rename = "toppings", skip_serializing_if = "Option::is_none")] @@ -49,4 +47,3 @@ impl PizzaSpeziale { } } - diff --git a/samples/client/others/rust/reqwest-regression-16119/src/models/parent.rs b/samples/client/others/rust/reqwest-regression-16119/src/models/parent.rs index 33dc7ddf02b6..620ea7cb4b94 100644 --- a/samples/client/others/rust/reqwest-regression-16119/src/models/parent.rs +++ b/samples/client/others/rust/reqwest-regression-16119/src/models/parent.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Parent { #[serde(rename = "child", skip_serializing_if = "Option::is_none")] @@ -26,4 +24,3 @@ impl Parent { } } - diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs index 9f7c5b26dcdb..8d7300058a44 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs @@ -10,7 +10,6 @@ use crate::models; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "realtype")] pub enum CreateStateRequest { @@ -27,5 +26,3 @@ impl Default for CreateStateRequest { } - - diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs index 25b8954b94be..2b424a07b764 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs @@ -10,7 +10,6 @@ use crate::models; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "realtype")] pub enum CustomOneOfArraySchemaInner { @@ -29,5 +28,3 @@ impl Default for CustomOneOfArraySchemaInner { } - - diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs index 0806f0cfd235..fd9844a8e2d0 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs @@ -10,7 +10,6 @@ use crate::models; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "realtype")] pub enum CustomOneOfSchema { @@ -27,5 +26,3 @@ impl Default for CustomOneOfSchema { } - - diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs index 033e98fc187f..94b4d6686368 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs @@ -10,7 +10,6 @@ use crate::models; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "realtype")] pub enum GetState200Response { @@ -29,5 +28,3 @@ impl Default for GetState200Response { } - - diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_a.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_a.rs index f115991d7e25..67e72b00fed4 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_a.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_a.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ObjA { #[serde(rename = "realtype", skip_serializing_if = "Option::is_none")] @@ -29,4 +27,3 @@ impl ObjA { } } - diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_b.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_b.rs index 58180b0d956c..835695c76619 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_b.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_b.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ObjB { #[serde(rename = "realtype", skip_serializing_if = "Option::is_none")] @@ -32,4 +30,3 @@ impl ObjB { } } - diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_c.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_c.rs index a5fb0d4cf90a..abc6aae24870 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_c.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_c.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ObjC { #[serde(rename = "realtype", skip_serializing_if = "Option::is_none")] @@ -29,4 +27,3 @@ impl ObjC { } } - diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_d.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_d.rs index 47cbead2f248..287c2f24e3e9 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_d.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_d.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ObjD { #[serde(rename = "realtype", skip_serializing_if = "Option::is_none")] @@ -29,4 +27,3 @@ impl ObjD { } } - diff --git a/samples/client/others/rust/reqwest/emptyObject/src/models/empty_object.rs b/samples/client/others/rust/reqwest/emptyObject/src/models/empty_object.rs index 7d16b214ac02..6db5fbff7ad2 100644 --- a/samples/client/others/rust/reqwest/emptyObject/src/models/empty_object.rs +++ b/samples/client/others/rust/reqwest/emptyObject/src/models/empty_object.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct EmptyObject { #[serde(rename = "emptyObject", skip_serializing_if = "Option::is_none")] @@ -26,4 +24,3 @@ impl EmptyObject { } } - diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/src/models/apple.rs b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/apple.rs index f62be5152188..8472b2a8e5a0 100644 --- a/samples/client/others/rust/reqwest/oneOf-array-map/src/models/apple.rs +++ b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/apple.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Apple { #[serde(rename = "kind", skip_serializing_if = "Option::is_none")] @@ -26,4 +24,3 @@ impl Apple { } } - diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/src/models/fruit.rs b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/fruit.rs index c3038084b6c3..ee270a67041f 100644 --- a/samples/client/others/rust/reqwest/oneOf-array-map/src/models/fruit.rs +++ b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/fruit.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(untagged)] pub enum Fruit { @@ -25,4 +23,3 @@ impl Default for Fruit { } } - diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/src/models/grape.rs b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/grape.rs index 244eccf95701..bc7d12681c4e 100644 --- a/samples/client/others/rust/reqwest/oneOf-array-map/src/models/grape.rs +++ b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/grape.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Grape { #[serde(rename = "color", skip_serializing_if = "Option::is_none")] @@ -26,4 +24,3 @@ impl Grape { } } - diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/addressable.rs b/samples/client/others/rust/reqwest/oneOf/src/models/addressable.rs index b9e4efbc2c7e..82d62ccc2883 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/addressable.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/addressable.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Addressable : Base schema for addressable entities - - +/// Addressable : Base schema for addressable entities #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Addressable { /// Hyperlink reference @@ -33,4 +31,3 @@ impl Addressable { } } - diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/apple.rs b/samples/client/others/rust/reqwest/oneOf/src/models/apple.rs index bb38460ec471..54b954846718 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/apple.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/apple.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Apple { #[serde(rename = "seeds")] @@ -26,4 +24,3 @@ impl Apple { } } - diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/banana.rs b/samples/client/others/rust/reqwest/oneOf/src/models/banana.rs index efc026edb86d..d026dbd2b8e5 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/banana.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/banana.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Banana { #[serde(rename = "length")] @@ -26,4 +24,3 @@ impl Banana { } } - diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/bar.rs b/samples/client/others/rust/reqwest/oneOf/src/models/bar.rs index 3355f39c45c3..7508b00b9af5 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/bar.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/bar.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Bar { #[serde(rename = "id")] @@ -51,4 +49,3 @@ impl Bar { } } - diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/bar_create.rs b/samples/client/others/rust/reqwest/oneOf/src/models/bar_create.rs index 9e9214758484..0afc67998fe4 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/bar_create.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/bar_create.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct BarCreate { #[serde(rename = "barPropA", skip_serializing_if = "Option::is_none")] @@ -52,4 +50,3 @@ impl BarCreate { } } - diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref.rs b/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref.rs index 9a63c35dcee0..42e2176fca0b 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct BarRef { /// Name of the related entity. @@ -51,4 +49,3 @@ impl BarRef { } } - diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref_or_value.rs b/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref_or_value.rs index 01b5749df7e0..61c3f57a4507 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref_or_value.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref_or_value.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(untagged)] pub enum BarRefOrValue { @@ -25,4 +23,3 @@ impl Default for BarRefOrValue { } } - diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/entity.rs b/samples/client/others/rust/reqwest/oneOf/src/models/entity.rs index 6c7a23734df8..b864cab686e0 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/entity.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/entity.rs @@ -10,7 +10,6 @@ use crate::models; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "@type")] pub enum Entity { @@ -119,5 +118,3 @@ impl Default for Entity { } - - diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/entity_ref.rs b/samples/client/others/rust/reqwest/oneOf/src/models/entity_ref.rs index 1c6ad9b5fb12..60773f6e9afb 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/entity_ref.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/entity_ref.rs @@ -9,9 +9,8 @@ */ use crate::models; -/// EntityRef : Entity reference schema to be use for all entityRef class. - +/// EntityRef : Entity reference schema to be use for all entityRef class. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "@type")] pub enum EntityRef { @@ -74,5 +73,3 @@ impl Default for EntityRef { } - - diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/extensible.rs b/samples/client/others/rust/reqwest/oneOf/src/models/extensible.rs index 732c793beb2e..d87abf5be19a 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/extensible.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/extensible.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Extensible { /// A URI to a JSON-Schema file that defines additional attributes and relationships @@ -35,4 +33,3 @@ impl Extensible { } } - diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/foo.rs b/samples/client/others/rust/reqwest/oneOf/src/models/foo.rs index d920a5ff6fac..be82765a3a89 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/foo.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/foo.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Foo { #[serde(rename = "fooPropA", skip_serializing_if = "Option::is_none")] @@ -49,4 +47,3 @@ impl Foo { } } - diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref.rs b/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref.rs index 670254c03834..11640d85a7ca 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct FooRef { #[serde(rename = "foorefPropA", skip_serializing_if = "Option::is_none")] @@ -54,4 +52,3 @@ impl FooRef { } } - diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref_or_value.rs b/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref_or_value.rs index c3901be7133b..e06ca7c1ffff 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref_or_value.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref_or_value.rs @@ -10,7 +10,6 @@ use crate::models; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "@type")] pub enum FooRefOrValue { @@ -25,5 +24,3 @@ impl Default for FooRefOrValue { } - - diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs b/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs index 23e19d97795a..ef068172592e 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs @@ -10,7 +10,6 @@ use crate::models; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "fruitType")] pub enum Fruit { @@ -27,5 +26,3 @@ impl Default for Fruit { } - - diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/fruit_type.rs b/samples/client/others/rust/reqwest/oneOf/src/models/fruit_type.rs index 8e84d6064f19..00f405a7846a 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/fruit_type.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/fruit_type.rs @@ -35,6 +35,3 @@ impl Default for FruitType { } } - - - diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/pasta.rs b/samples/client/others/rust/reqwest/oneOf/src/models/pasta.rs index 9c9b98c5b15a..69ae5110cf6d 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/pasta.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/pasta.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Pasta { #[serde(rename = "vendor", skip_serializing_if = "Option::is_none")] @@ -46,4 +44,3 @@ impl Pasta { } } - diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/pizza.rs b/samples/client/others/rust/reqwest/oneOf/src/models/pizza.rs index ec55562e478b..6ae7f457df41 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/pizza.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/pizza.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Pizza { #[serde(rename = "pizzaSize", skip_serializing_if = "Option::is_none")] @@ -46,4 +44,3 @@ impl Pizza { } } - diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/pizza_speziale.rs b/samples/client/others/rust/reqwest/oneOf/src/models/pizza_speziale.rs index ad98d13c7937..e1c5258c616d 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/pizza_speziale.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/pizza_speziale.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct PizzaSpeziale { #[serde(rename = "toppings", skip_serializing_if = "Option::is_none")] @@ -49,4 +47,3 @@ impl PizzaSpeziale { } } - diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/action_container.rs b/samples/client/petstore/rust/hyper/petstore/src/models/action_container.rs index fea1f5eee3c6..81cca99e8ac1 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/action_container.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/action_container.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ActionContainer { #[serde(rename = "action")] @@ -26,4 +24,3 @@ impl ActionContainer { } } - diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/api_response.rs b/samples/client/petstore/rust/hyper/petstore/src/models/api_response.rs index 1549ec2c4aab..4814a31da533 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/api_response.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/api_response.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// ApiResponse : Describes the result of uploading an image resource - - +/// ApiResponse : Describes the result of uploading an image resource #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ApiResponse { #[serde(rename = "code", skip_serializing_if = "Option::is_none")] @@ -34,4 +32,3 @@ impl ApiResponse { } } - diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/array_item_ref_test.rs b/samples/client/petstore/rust/hyper/petstore/src/models/array_item_ref_test.rs index d02f0994d272..5948b1809125 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/array_item_ref_test.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/array_item_ref_test.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// ArrayItemRefTest : Test handling of object reference in arrays - - +/// ArrayItemRefTest : Test handling of object reference in arrays #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ArrayItemRefTest { #[serde(rename = "list_with_array_ref")] @@ -31,4 +29,3 @@ impl ArrayItemRefTest { } } - diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/baz.rs b/samples/client/petstore/rust/hyper/petstore/src/models/baz.rs index 83ce57798295..d2a840a2d671 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/baz.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/baz.rs @@ -9,8 +9,8 @@ */ use crate::models; -/// Baz : Test handling of empty variants +/// Baz : Test handling of empty variants /// Test handling of empty variants #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Baz { @@ -39,6 +39,3 @@ impl Default for Baz { } } - - - diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/category.rs b/samples/client/petstore/rust/hyper/petstore/src/models/category.rs index 04e4dcbbfaa1..2d2b29334de7 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/category.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/category.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Category : A category for a pet - - +/// Category : A category for a pet #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Category { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -31,4 +29,3 @@ impl Category { } } - diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/enum_array_testing.rs b/samples/client/petstore/rust/hyper/petstore/src/models/enum_array_testing.rs index 72e8250256f4..499c33595131 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/enum_array_testing.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/enum_array_testing.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// EnumArrayTesting : Test of enum array - - +/// EnumArrayTesting : Test of enum array #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct EnumArrayTesting { #[serde(rename = "required_enums")] @@ -27,7 +25,6 @@ impl EnumArrayTesting { } } } - /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum RequiredEnums { diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/model_return.rs b/samples/client/petstore/rust/hyper/petstore/src/models/model_return.rs index 217798de6db8..933b644a7f3e 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/model_return.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/model_return.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Return : Test using keywords - - +/// Return : Test using keywords #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Return { #[serde(rename = "match", skip_serializing_if = "Option::is_none")] @@ -34,4 +32,3 @@ impl Return { } } - diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/nullable_array.rs b/samples/client/petstore/rust/hyper/petstore/src/models/nullable_array.rs index e21b8259a128..6ddbb5c0ecee 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/nullable_array.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/nullable_array.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct NullableArray { #[serde(rename = "array_nullable", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] @@ -35,4 +33,3 @@ impl NullableArray { } } - diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/optional_testing.rs b/samples/client/petstore/rust/hyper/petstore/src/models/optional_testing.rs index c546258b5aec..57d224f831d9 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/optional_testing.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/optional_testing.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// OptionalTesting : Test handling of optional and nullable fields - - +/// OptionalTesting : Test handling of optional and nullable fields #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct OptionalTesting { #[serde(rename = "optional_nonnull", skip_serializing_if = "Option::is_none")] @@ -37,4 +35,3 @@ impl OptionalTesting { } } - diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/order.rs b/samples/client/petstore/rust/hyper/petstore/src/models/order.rs index 68bc1ffe42d3..5d16df143aac 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/order.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/order.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Order : An order for a pets from the pet store - - +/// Order : An order for a pets from the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Order { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -43,7 +41,6 @@ impl Order { } } } - /// Order Status #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Status { diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/pet.rs b/samples/client/petstore/rust/hyper/petstore/src/models/pet.rs index 81b04f120f66..59d9a9f11587 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/pet.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/pet.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Pet : A pet for sale in the pet store - - +/// Pet : A pet for sale in the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Pet { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -43,7 +41,6 @@ impl Pet { } } } - /// pet status in the store #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Status { diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/property_test.rs b/samples/client/petstore/rust/hyper/petstore/src/models/property_test.rs index d058b5cd2285..1b92525f28b9 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/property_test.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/property_test.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// PropertyTest : A model to test various formats, e.g. UUID - - +/// PropertyTest : A model to test various formats, e.g. UUID #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct PropertyTest { #[serde(rename = "uuid", skip_serializing_if = "Option::is_none")] @@ -28,4 +26,3 @@ impl PropertyTest { } } - diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/tag.rs b/samples/client/petstore/rust/hyper/petstore/src/models/tag.rs index f42257d0bce7..151840c88567 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/tag.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/tag.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Tag : A tag for a pet - - +/// Tag : A tag for a pet #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Tag { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -31,4 +29,3 @@ impl Tag { } } - diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/type_testing.rs b/samples/client/petstore/rust/hyper/petstore/src/models/type_testing.rs index f1f7c4171e27..2a821fb24d50 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/type_testing.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/type_testing.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// TypeTesting : Test handling of different field data types - - +/// TypeTesting : Test handling of different field data types #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct TypeTesting { #[serde(rename = "int32")] @@ -46,4 +44,3 @@ impl TypeTesting { } } - diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/unique_item_array_testing.rs b/samples/client/petstore/rust/hyper/petstore/src/models/unique_item_array_testing.rs index 16591be2f7ea..a40f77afc0ed 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/unique_item_array_testing.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/unique_item_array_testing.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// UniqueItemArrayTesting : Test handling of enum array with unique items - - +/// UniqueItemArrayTesting : Test handling of enum array with unique items #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct UniqueItemArrayTesting { /// Helper object for the unique item array test @@ -28,7 +26,6 @@ impl UniqueItemArrayTesting { } } } - /// Helper object for the unique item array test #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum UniqueItemArray { diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/user.rs b/samples/client/petstore/rust/hyper/petstore/src/models/user.rs index 065e590b2c24..f16b7f785f77 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/user.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/user.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// User : A User who is purchasing from the pet store - - +/// User : A User who is purchasing from the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct User { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -50,4 +48,3 @@ impl User { } } - diff --git a/samples/client/petstore/rust/reqwest/name-mapping/src/models/property_name_mapping.rs b/samples/client/petstore/rust/reqwest/name-mapping/src/models/property_name_mapping.rs index e64ebbe76c8a..e420ed1280c4 100644 --- a/samples/client/petstore/rust/reqwest/name-mapping/src/models/property_name_mapping.rs +++ b/samples/client/petstore/rust/reqwest/name-mapping/src/models/property_name_mapping.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct PropertyNameMapping { #[serde(rename = "http_debug_operation", skip_serializing_if = "Option::is_none")] @@ -38,4 +36,3 @@ impl PropertyNameMapping { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/action_container.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/action_container.rs index fea1f5eee3c6..81cca99e8ac1 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/action_container.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/action_container.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ActionContainer { #[serde(rename = "action")] @@ -26,4 +24,3 @@ impl ActionContainer { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/api_response.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/api_response.rs index 1549ec2c4aab..4814a31da533 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/api_response.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/api_response.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// ApiResponse : Describes the result of uploading an image resource - - +/// ApiResponse : Describes the result of uploading an image resource #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ApiResponse { #[serde(rename = "code", skip_serializing_if = "Option::is_none")] @@ -34,4 +32,3 @@ impl ApiResponse { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/array_item_ref_test.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/array_item_ref_test.rs index d02f0994d272..5948b1809125 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/array_item_ref_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/array_item_ref_test.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// ArrayItemRefTest : Test handling of object reference in arrays - - +/// ArrayItemRefTest : Test handling of object reference in arrays #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ArrayItemRefTest { #[serde(rename = "list_with_array_ref")] @@ -31,4 +29,3 @@ impl ArrayItemRefTest { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/baz.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/baz.rs index 83ce57798295..d2a840a2d671 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/baz.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/baz.rs @@ -9,8 +9,8 @@ */ use crate::models; -/// Baz : Test handling of empty variants +/// Baz : Test handling of empty variants /// Test handling of empty variants #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Baz { @@ -39,6 +39,3 @@ impl Default for Baz { } } - - - diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/category.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/category.rs index 04e4dcbbfaa1..2d2b29334de7 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/category.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/category.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Category : A category for a pet - - +/// Category : A category for a pet #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Category { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -31,4 +29,3 @@ impl Category { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/enum_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/enum_array_testing.rs index 72e8250256f4..499c33595131 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/enum_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/enum_array_testing.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// EnumArrayTesting : Test of enum array - - +/// EnumArrayTesting : Test of enum array #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct EnumArrayTesting { #[serde(rename = "required_enums")] @@ -27,7 +25,6 @@ impl EnumArrayTesting { } } } - /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum RequiredEnums { diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/model_return.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/model_return.rs index 217798de6db8..933b644a7f3e 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/model_return.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/model_return.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Return : Test using keywords - - +/// Return : Test using keywords #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Return { #[serde(rename = "match", skip_serializing_if = "Option::is_none")] @@ -34,4 +32,3 @@ impl Return { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/nullable_array.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/nullable_array.rs index e21b8259a128..6ddbb5c0ecee 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/nullable_array.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/nullable_array.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct NullableArray { #[serde(rename = "array_nullable", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] @@ -35,4 +33,3 @@ impl NullableArray { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/optional_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/optional_testing.rs index c546258b5aec..57d224f831d9 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/optional_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/optional_testing.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// OptionalTesting : Test handling of optional and nullable fields - - +/// OptionalTesting : Test handling of optional and nullable fields #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct OptionalTesting { #[serde(rename = "optional_nonnull", skip_serializing_if = "Option::is_none")] @@ -37,4 +35,3 @@ impl OptionalTesting { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/order.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/order.rs index 68bc1ffe42d3..5d16df143aac 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/order.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/order.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Order : An order for a pets from the pet store - - +/// Order : An order for a pets from the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Order { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -43,7 +41,6 @@ impl Order { } } } - /// Order Status #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Status { diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/pet.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/pet.rs index 81b04f120f66..59d9a9f11587 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/pet.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/pet.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Pet : A pet for sale in the pet store - - +/// Pet : A pet for sale in the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Pet { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -43,7 +41,6 @@ impl Pet { } } } - /// pet status in the store #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Status { diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/property_test.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/property_test.rs index d058b5cd2285..1b92525f28b9 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/property_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/property_test.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// PropertyTest : A model to test various formats, e.g. UUID - - +/// PropertyTest : A model to test various formats, e.g. UUID #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct PropertyTest { #[serde(rename = "uuid", skip_serializing_if = "Option::is_none")] @@ -28,4 +26,3 @@ impl PropertyTest { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/tag.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/tag.rs index f42257d0bce7..151840c88567 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/tag.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/tag.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Tag : A tag for a pet - - +/// Tag : A tag for a pet #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Tag { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -31,4 +29,3 @@ impl Tag { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/type_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/type_testing.rs index f1f7c4171e27..2a821fb24d50 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/type_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/type_testing.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// TypeTesting : Test handling of different field data types - - +/// TypeTesting : Test handling of different field data types #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct TypeTesting { #[serde(rename = "int32")] @@ -46,4 +44,3 @@ impl TypeTesting { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/unique_item_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/unique_item_array_testing.rs index 16591be2f7ea..a40f77afc0ed 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/unique_item_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/unique_item_array_testing.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// UniqueItemArrayTesting : Test handling of enum array with unique items - - +/// UniqueItemArrayTesting : Test handling of enum array with unique items #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct UniqueItemArrayTesting { /// Helper object for the unique item array test @@ -28,7 +26,6 @@ impl UniqueItemArrayTesting { } } } - /// Helper object for the unique item array test #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum UniqueItemArray { diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/user.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/user.rs index 065e590b2c24..f16b7f785f77 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/user.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/user.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// User : A User who is purchasing from the pet store - - +/// User : A User who is purchasing from the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct User { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -50,4 +48,3 @@ impl User { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/action_container.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/action_container.rs index fea1f5eee3c6..81cca99e8ac1 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/action_container.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/action_container.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ActionContainer { #[serde(rename = "action")] @@ -26,4 +24,3 @@ impl ActionContainer { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/api_response.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/api_response.rs index 1549ec2c4aab..4814a31da533 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/api_response.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/api_response.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// ApiResponse : Describes the result of uploading an image resource - - +/// ApiResponse : Describes the result of uploading an image resource #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ApiResponse { #[serde(rename = "code", skip_serializing_if = "Option::is_none")] @@ -34,4 +32,3 @@ impl ApiResponse { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/array_item_ref_test.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/array_item_ref_test.rs index d02f0994d272..5948b1809125 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/array_item_ref_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/array_item_ref_test.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// ArrayItemRefTest : Test handling of object reference in arrays - - +/// ArrayItemRefTest : Test handling of object reference in arrays #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ArrayItemRefTest { #[serde(rename = "list_with_array_ref")] @@ -31,4 +29,3 @@ impl ArrayItemRefTest { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/baz.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/baz.rs index 83ce57798295..d2a840a2d671 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/baz.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/baz.rs @@ -9,8 +9,8 @@ */ use crate::models; -/// Baz : Test handling of empty variants +/// Baz : Test handling of empty variants /// Test handling of empty variants #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Baz { @@ -39,6 +39,3 @@ impl Default for Baz { } } - - - diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/category.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/category.rs index 04e4dcbbfaa1..2d2b29334de7 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/category.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/category.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Category : A category for a pet - - +/// Category : A category for a pet #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Category { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -31,4 +29,3 @@ impl Category { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/enum_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/enum_array_testing.rs index 72e8250256f4..499c33595131 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/enum_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/enum_array_testing.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// EnumArrayTesting : Test of enum array - - +/// EnumArrayTesting : Test of enum array #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct EnumArrayTesting { #[serde(rename = "required_enums")] @@ -27,7 +25,6 @@ impl EnumArrayTesting { } } } - /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum RequiredEnums { diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/model_return.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/model_return.rs index 217798de6db8..933b644a7f3e 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/model_return.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/model_return.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Return : Test using keywords - - +/// Return : Test using keywords #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Return { #[serde(rename = "match", skip_serializing_if = "Option::is_none")] @@ -34,4 +32,3 @@ impl Return { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/nullable_array.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/nullable_array.rs index e21b8259a128..6ddbb5c0ecee 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/nullable_array.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/nullable_array.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct NullableArray { #[serde(rename = "array_nullable", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] @@ -35,4 +33,3 @@ impl NullableArray { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/optional_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/optional_testing.rs index c546258b5aec..57d224f831d9 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/optional_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/optional_testing.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// OptionalTesting : Test handling of optional and nullable fields - - +/// OptionalTesting : Test handling of optional and nullable fields #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct OptionalTesting { #[serde(rename = "optional_nonnull", skip_serializing_if = "Option::is_none")] @@ -37,4 +35,3 @@ impl OptionalTesting { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/order.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/order.rs index 68bc1ffe42d3..5d16df143aac 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/order.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/order.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Order : An order for a pets from the pet store - - +/// Order : An order for a pets from the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Order { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -43,7 +41,6 @@ impl Order { } } } - /// Order Status #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Status { diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/pet.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/pet.rs index 81b04f120f66..59d9a9f11587 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/pet.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/pet.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Pet : A pet for sale in the pet store - - +/// Pet : A pet for sale in the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Pet { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -43,7 +41,6 @@ impl Pet { } } } - /// pet status in the store #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Status { diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/property_test.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/property_test.rs index d058b5cd2285..1b92525f28b9 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/property_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/property_test.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// PropertyTest : A model to test various formats, e.g. UUID - - +/// PropertyTest : A model to test various formats, e.g. UUID #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct PropertyTest { #[serde(rename = "uuid", skip_serializing_if = "Option::is_none")] @@ -28,4 +26,3 @@ impl PropertyTest { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/tag.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/tag.rs index f42257d0bce7..151840c88567 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/tag.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/tag.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Tag : A tag for a pet - - +/// Tag : A tag for a pet #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Tag { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -31,4 +29,3 @@ impl Tag { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/type_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/type_testing.rs index f1f7c4171e27..2a821fb24d50 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/type_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/type_testing.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// TypeTesting : Test handling of different field data types - - +/// TypeTesting : Test handling of different field data types #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct TypeTesting { #[serde(rename = "int32")] @@ -46,4 +44,3 @@ impl TypeTesting { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/unique_item_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/unique_item_array_testing.rs index 16591be2f7ea..a40f77afc0ed 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/unique_item_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/unique_item_array_testing.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// UniqueItemArrayTesting : Test handling of enum array with unique items - - +/// UniqueItemArrayTesting : Test handling of enum array with unique items #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct UniqueItemArrayTesting { /// Helper object for the unique item array test @@ -28,7 +26,6 @@ impl UniqueItemArrayTesting { } } } - /// Helper object for the unique item array test #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum UniqueItemArray { diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/user.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/user.rs index 065e590b2c24..f16b7f785f77 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/user.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/user.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// User : A User who is purchasing from the pet store - - +/// User : A User who is purchasing from the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct User { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -50,4 +48,3 @@ impl User { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/action_container.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/action_container.rs index fea1f5eee3c6..81cca99e8ac1 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/action_container.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/action_container.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ActionContainer { #[serde(rename = "action")] @@ -26,4 +24,3 @@ impl ActionContainer { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/api_response.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/api_response.rs index 1549ec2c4aab..4814a31da533 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/api_response.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/api_response.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// ApiResponse : Describes the result of uploading an image resource - - +/// ApiResponse : Describes the result of uploading an image resource #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ApiResponse { #[serde(rename = "code", skip_serializing_if = "Option::is_none")] @@ -34,4 +32,3 @@ impl ApiResponse { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/array_item_ref_test.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/array_item_ref_test.rs index d02f0994d272..5948b1809125 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/array_item_ref_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/array_item_ref_test.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// ArrayItemRefTest : Test handling of object reference in arrays - - +/// ArrayItemRefTest : Test handling of object reference in arrays #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ArrayItemRefTest { #[serde(rename = "list_with_array_ref")] @@ -31,4 +29,3 @@ impl ArrayItemRefTest { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/baz.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/baz.rs index 83ce57798295..d2a840a2d671 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/baz.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/baz.rs @@ -9,8 +9,8 @@ */ use crate::models; -/// Baz : Test handling of empty variants +/// Baz : Test handling of empty variants /// Test handling of empty variants #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Baz { @@ -39,6 +39,3 @@ impl Default for Baz { } } - - - diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/category.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/category.rs index 04e4dcbbfaa1..2d2b29334de7 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/category.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/category.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Category : A category for a pet - - +/// Category : A category for a pet #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Category { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -31,4 +29,3 @@ impl Category { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/enum_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/enum_array_testing.rs index 72e8250256f4..499c33595131 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/enum_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/enum_array_testing.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// EnumArrayTesting : Test of enum array - - +/// EnumArrayTesting : Test of enum array #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct EnumArrayTesting { #[serde(rename = "required_enums")] @@ -27,7 +25,6 @@ impl EnumArrayTesting { } } } - /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum RequiredEnums { diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/model_return.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/model_return.rs index 217798de6db8..933b644a7f3e 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/model_return.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/model_return.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Return : Test using keywords - - +/// Return : Test using keywords #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Return { #[serde(rename = "match", skip_serializing_if = "Option::is_none")] @@ -34,4 +32,3 @@ impl Return { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/nullable_array.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/nullable_array.rs index e21b8259a128..6ddbb5c0ecee 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/nullable_array.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/nullable_array.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct NullableArray { #[serde(rename = "array_nullable", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] @@ -35,4 +33,3 @@ impl NullableArray { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/optional_testing.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/optional_testing.rs index c546258b5aec..57d224f831d9 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/optional_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/optional_testing.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// OptionalTesting : Test handling of optional and nullable fields - - +/// OptionalTesting : Test handling of optional and nullable fields #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct OptionalTesting { #[serde(rename = "optional_nonnull", skip_serializing_if = "Option::is_none")] @@ -37,4 +35,3 @@ impl OptionalTesting { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/order.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/order.rs index 68bc1ffe42d3..5d16df143aac 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/order.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/order.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Order : An order for a pets from the pet store - - +/// Order : An order for a pets from the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Order { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -43,7 +41,6 @@ impl Order { } } } - /// Order Status #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Status { diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/pet.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/pet.rs index 81b04f120f66..59d9a9f11587 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/pet.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/pet.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Pet : A pet for sale in the pet store - - +/// Pet : A pet for sale in the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Pet { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -43,7 +41,6 @@ impl Pet { } } } - /// pet status in the store #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Status { diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/property_test.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/property_test.rs index d058b5cd2285..1b92525f28b9 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/property_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/property_test.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// PropertyTest : A model to test various formats, e.g. UUID - - +/// PropertyTest : A model to test various formats, e.g. UUID #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct PropertyTest { #[serde(rename = "uuid", skip_serializing_if = "Option::is_none")] @@ -28,4 +26,3 @@ impl PropertyTest { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/tag.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/tag.rs index f42257d0bce7..151840c88567 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/tag.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/tag.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Tag : A tag for a pet - - +/// Tag : A tag for a pet #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Tag { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -31,4 +29,3 @@ impl Tag { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/type_testing.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/type_testing.rs index f1f7c4171e27..2a821fb24d50 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/type_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/type_testing.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// TypeTesting : Test handling of different field data types - - +/// TypeTesting : Test handling of different field data types #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct TypeTesting { #[serde(rename = "int32")] @@ -46,4 +44,3 @@ impl TypeTesting { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/unique_item_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/unique_item_array_testing.rs index 16591be2f7ea..a40f77afc0ed 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/unique_item_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/unique_item_array_testing.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// UniqueItemArrayTesting : Test handling of enum array with unique items - - +/// UniqueItemArrayTesting : Test handling of enum array with unique items #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct UniqueItemArrayTesting { /// Helper object for the unique item array test @@ -28,7 +26,6 @@ impl UniqueItemArrayTesting { } } } - /// Helper object for the unique item array test #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum UniqueItemArray { diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/user.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/user.rs index 065e590b2c24..f16b7f785f77 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/user.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/user.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// User : A User who is purchasing from the pet store - - +/// User : A User who is purchasing from the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct User { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -50,4 +48,3 @@ impl User { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/action_container.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/action_container.rs index fea1f5eee3c6..81cca99e8ac1 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/action_container.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/action_container.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ActionContainer { #[serde(rename = "action")] @@ -26,4 +24,3 @@ impl ActionContainer { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/api_response.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/api_response.rs index 1549ec2c4aab..4814a31da533 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/api_response.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/api_response.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// ApiResponse : Describes the result of uploading an image resource - - +/// ApiResponse : Describes the result of uploading an image resource #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ApiResponse { #[serde(rename = "code", skip_serializing_if = "Option::is_none")] @@ -34,4 +32,3 @@ impl ApiResponse { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/array_item_ref_test.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/array_item_ref_test.rs index d02f0994d272..5948b1809125 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/array_item_ref_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/array_item_ref_test.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// ArrayItemRefTest : Test handling of object reference in arrays - - +/// ArrayItemRefTest : Test handling of object reference in arrays #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ArrayItemRefTest { #[serde(rename = "list_with_array_ref")] @@ -31,4 +29,3 @@ impl ArrayItemRefTest { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/baz.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/baz.rs index 83ce57798295..d2a840a2d671 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/baz.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/baz.rs @@ -9,8 +9,8 @@ */ use crate::models; -/// Baz : Test handling of empty variants +/// Baz : Test handling of empty variants /// Test handling of empty variants #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Baz { @@ -39,6 +39,3 @@ impl Default for Baz { } } - - - diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/category.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/category.rs index 04e4dcbbfaa1..2d2b29334de7 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/category.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/category.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Category : A category for a pet - - +/// Category : A category for a pet #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Category { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -31,4 +29,3 @@ impl Category { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/enum_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/enum_array_testing.rs index 72e8250256f4..499c33595131 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/enum_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/enum_array_testing.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// EnumArrayTesting : Test of enum array - - +/// EnumArrayTesting : Test of enum array #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct EnumArrayTesting { #[serde(rename = "required_enums")] @@ -27,7 +25,6 @@ impl EnumArrayTesting { } } } - /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum RequiredEnums { diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/model_return.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/model_return.rs index 217798de6db8..933b644a7f3e 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/model_return.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/model_return.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Return : Test using keywords - - +/// Return : Test using keywords #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Return { #[serde(rename = "match", skip_serializing_if = "Option::is_none")] @@ -34,4 +32,3 @@ impl Return { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/nullable_array.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/nullable_array.rs index e21b8259a128..6ddbb5c0ecee 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/nullable_array.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/nullable_array.rs @@ -10,8 +10,6 @@ use crate::models; - - #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct NullableArray { #[serde(rename = "array_nullable", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] @@ -35,4 +33,3 @@ impl NullableArray { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/optional_testing.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/optional_testing.rs index c546258b5aec..57d224f831d9 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/optional_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/optional_testing.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// OptionalTesting : Test handling of optional and nullable fields - - +/// OptionalTesting : Test handling of optional and nullable fields #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct OptionalTesting { #[serde(rename = "optional_nonnull", skip_serializing_if = "Option::is_none")] @@ -37,4 +35,3 @@ impl OptionalTesting { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/order.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/order.rs index df13ede614d0..d27d4f8893e4 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/order.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/order.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Order : An order for a pets from the pet store - - +/// Order : An order for a pets from the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Order { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -43,7 +41,6 @@ impl Order { } } } - /// Order Status #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Status { diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs index 81b04f120f66..59d9a9f11587 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Pet : A pet for sale in the pet store - - +/// Pet : A pet for sale in the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Pet { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -43,7 +41,6 @@ impl Pet { } } } - /// pet status in the store #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Status { diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/property_test.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/property_test.rs index d058b5cd2285..1b92525f28b9 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/property_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/property_test.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// PropertyTest : A model to test various formats, e.g. UUID - - +/// PropertyTest : A model to test various formats, e.g. UUID #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct PropertyTest { #[serde(rename = "uuid", skip_serializing_if = "Option::is_none")] @@ -28,4 +26,3 @@ impl PropertyTest { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/tag.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/tag.rs index f42257d0bce7..151840c88567 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/tag.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/tag.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// Tag : A tag for a pet - - +/// Tag : A tag for a pet #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Tag { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -31,4 +29,3 @@ impl Tag { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/type_testing.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/type_testing.rs index f1f7c4171e27..2a821fb24d50 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/type_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/type_testing.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// TypeTesting : Test handling of different field data types - - +/// TypeTesting : Test handling of different field data types #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct TypeTesting { #[serde(rename = "int32")] @@ -46,4 +44,3 @@ impl TypeTesting { } } - diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/unique_item_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/unique_item_array_testing.rs index 16591be2f7ea..a40f77afc0ed 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/unique_item_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/unique_item_array_testing.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// UniqueItemArrayTesting : Test handling of enum array with unique items - - +/// UniqueItemArrayTesting : Test handling of enum array with unique items #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct UniqueItemArrayTesting { /// Helper object for the unique item array test @@ -28,7 +26,6 @@ impl UniqueItemArrayTesting { } } } - /// Helper object for the unique item array test #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum UniqueItemArray { diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/user.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/user.rs index 065e590b2c24..f16b7f785f77 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/user.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/user.rs @@ -9,10 +9,8 @@ */ use crate::models; -/// User : A User who is purchasing from the pet store - - +/// User : A User who is purchasing from the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct User { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] @@ -50,4 +48,3 @@ impl User { } } - From 91e0dce47c04399fff27ee29d98038f8b9811704 Mon Sep 17 00:00:00 2001 From: Artem Medvedev Date: Wed, 21 Feb 2024 14:37:32 +0100 Subject: [PATCH 07/13] fix: user toModelName for aliases of oneOf --- .../openapitools/codegen/languages/RustClientCodegen.java | 2 +- .../others/rust/hyper/oneOf-array-map/src/models/fruit.rs | 6 +++--- .../others/rust/reqwest/oneOf-array-map/src/models/fruit.rs | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java index b20f655467fa..4c92eae0b5d8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java @@ -232,7 +232,7 @@ public CodegenModel fromModel(String name, Schema model) { Schema schema = schemas.get(i); String aliasName = ModelUtils.getSimpleRef(schema.get$ref()); if (aliasName != null) { - oneOf.setName(aliasName); + oneOf.setName(toModelName(aliasName)); } if (oneOf.getRef() != null) { oneOf.setBaseName(mappedNameByRef.get(oneOf.getRef())); diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/models/fruit.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/models/fruit.rs index ee270a67041f..0bcac735277e 100644 --- a/samples/client/others/rust/hyper/oneOf-array-map/src/models/fruit.rs +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/models/fruit.rs @@ -13,13 +13,13 @@ use crate::models; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(untagged)] pub enum Fruit { - apples(Box>), - grapes(Box>), + Apples(Box>), + Grapes(Box>), } impl Default for Fruit { fn default() -> Self { - Self::apples(Box::default()) + Self::Apples(Box::default()) } } diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/src/models/fruit.rs b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/fruit.rs index ee270a67041f..0bcac735277e 100644 --- a/samples/client/others/rust/reqwest/oneOf-array-map/src/models/fruit.rs +++ b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/fruit.rs @@ -13,13 +13,13 @@ use crate::models; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(untagged)] pub enum Fruit { - apples(Box>), - grapes(Box>), + Apples(Box>), + Grapes(Box>), } impl Default for Fruit { fn default() -> Self { - Self::apples(Box::default()) + Self::Apples(Box::default()) } } From 401bedbb65952cd06e3799e5ea5c3ba442a5da90 Mon Sep 17 00:00:00 2001 From: Artem Medvedev Date: Wed, 21 Feb 2024 15:32:18 +0100 Subject: [PATCH 08/13] refactor: unify `getTypeDeclaration` for rust --- .../languages/AbstractRustCodegen.java | 17 +++++++++++++++-- .../codegen/languages/RustClientCodegen.java | 19 ++----------------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRustCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRustCodegen.java index 2178c657ab36..94d6cb36385c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRustCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRustCodegen.java @@ -250,7 +250,7 @@ public String getTypeDeclaration(Schema p) { String datatype; try { datatype = toModelName(ModelUtils.getSimpleRef(p.get$ref())); - datatype = "models::" + datatype; + datatype = "models::" + toModelName(datatype); } catch (Exception e) { LOGGER.warn("Error obtaining the datatype from schema (model):{}. Datatype default to Object", p); datatype = "Object"; @@ -261,7 +261,20 @@ public String getTypeDeclaration(Schema p) { return typeMapping.get("file"); } - return super.getTypeDeclaration(p); + String oasType = getSchemaType(p); + if (typeMapping.containsKey(oasType)) { + return typeMapping.get(oasType); + } + + if (typeMapping.containsValue(oasType)) { + return oasType; + } + + if (languageSpecificPrimitives.contains(oasType)) { + return oasType; + } + + return "models::" + toModelName(oasType); } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java index 4c92eae0b5d8..da4ce6a79ca4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java @@ -439,24 +439,9 @@ public String modelDocFileFolder() { @Override public String getTypeDeclaration(Schema p) { + // use unaliased schema for client-side Schema unaliasSchema = unaliasSchema(p); - String typeDeclaration = super.getTypeDeclaration(unaliasSchema); - - // Check if we need to UpperCamelize the type after super invocation - String schemaType = getSchemaType(unaliasSchema); - if (typeDeclaration.equals(schemaType)) { - if (typeMapping.containsValue(schemaType)) { - return schemaType; - } - - if (languageSpecificPrimitives.contains(schemaType)) { - return schemaType; - } - - typeDeclaration = "models::" + toModelName(schemaType); - } - - return typeDeclaration; + return super.getTypeDeclaration(unaliasSchema); } @Override From adc0c735c79e8f2ffcca6d68beceddf019e13970 Mon Sep 17 00:00:00 2001 From: Artem Medvedev Date: Wed, 21 Feb 2024 21:36:26 +0100 Subject: [PATCH 09/13] cover the case when `mapping` has the same `ref` for different mapping names --- .../codegen/languages/RustClientCodegen.java | 47 ++++++++++++------- .../src/main/resources/rust/model.mustache | 2 +- .../src/models/create_state_request.rs | 6 +-- .../custom_one_of_array_schema_inner.rs | 8 ++-- .../src/models/custom_one_of_schema.rs | 6 +-- .../src/models/get_state_200_response.rs | 8 ++-- .../oneOf/src/models/foo_ref_or_value.rs | 2 + .../src/models/create_state_request.rs | 6 +-- .../custom_one_of_array_schema_inner.rs | 8 ++-- .../src/models/custom_one_of_schema.rs | 6 +-- .../src/models/get_state_200_response.rs | 8 ++-- .../oneOf/src/models/foo_ref_or_value.rs | 2 + 12 files changed, 62 insertions(+), 47 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java index da4ce6a79ca4..fc5fb370d84d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java @@ -212,33 +212,44 @@ public CodegenModel fromModel(String name, Schema model) { if (mdl.getComposedSchemas() != null && mdl.getComposedSchemas().getOneOf() != null && !mdl.getComposedSchemas().getOneOf().isEmpty()) { + List newOneOfs = mdl.getComposedSchemas().getOneOf().stream() + .map(CodegenProperty::clone) + .collect(Collectors.toList()); List schemas = ModelUtils.getInterfaces(model); - List oneOfs = mdl.getComposedSchemas().getOneOf(); - if (oneOfs.size() != schemas.size()) { + if (newOneOfs.size() != schemas.size()) { // For safety reasons, this should never happen unless there is an error in the code throw new RuntimeException("oneOf size does not match the model"); } - Map mappedNameByRef = Optional.ofNullable(model.getDiscriminator()) - .map(Discriminator::getMapping) - .map(mapping -> mapping.entrySet() - .stream() - .collect(Collectors.toMap(Map.Entry::getValue, Map.Entry::getKey)) - ) - .orElse(Collections.emptyMap()); + Map refsMapping = Optional.ofNullable(model.getDiscriminator()) + .map(Discriminator::getMapping).orElse(Collections.emptyMap()); - for (int i = 0; i < oneOfs.size(); i++) { - CodegenProperty oneOf = oneOfs.get(i); + // Reverse mapped references to use as baseName for oneOF, but different keys may point to the same $ref. + // Thus, we group them by the value + Map> mappedNamesByRef = refsMapping.entrySet().stream() + .collect(Collectors.groupingBy(Map.Entry::getValue, + Collectors.mapping(Map.Entry::getKey, Collectors.toList()) + )); + + for (int i = 0; i < newOneOfs.size(); i++) { + CodegenProperty oneOf = newOneOfs.get(i); Schema schema = schemas.get(i); - String aliasName = ModelUtils.getSimpleRef(schema.get$ref()); - if (aliasName != null) { - oneOf.setName(toModelName(aliasName)); - } - if (oneOf.getRef() != null) { - oneOf.setBaseName(mappedNameByRef.get(oneOf.getRef())); - } + if (mappedNamesByRef.containsKey(schema.get$ref())) { + String mappedName = mappedNamesByRef.get(schema.get$ref()).removeFirst(); + oneOf.setBaseName(mappedName); + oneOf.setName(toModelName(mappedName)); + } else { + String refName = ModelUtils.getSimpleRef(schema.get$ref()); + if (refName != null) { + String modelName = toModelName(refName); + oneOf.setName(modelName); + oneOf.setBaseName(refName); + } + } } + + mdl.getComposedSchemas().setOneOf(newOneOfs); } return mdl; diff --git a/modules/openapi-generator/src/main/resources/rust/model.mustache b/modules/openapi-generator/src/main/resources/rust/model.mustache index f00d63a5af7a..f54d6c38937e 100644 --- a/modules/openapi-generator/src/main/resources/rust/model.mustache +++ b/modules/openapi-generator/src/main/resources/rust/model.mustache @@ -77,7 +77,7 @@ impl Default for {{classname}} { {{{name}}}: Default::default(), {{/vars}} }{{/-first}}{{/mappedModels}} - {{/oneOf}}{{^oneOf.isEmpty}}{{#mappedModels}}{{#-first}}Self::{{{modelName}}}(Box::default()){{/-first}}{{/mappedModels}}{{^mappedModels}}{{#composedSchemas.oneOf}}{{#-first}}Self::{{{name}}}(Box::default()){{/-first}}{{/composedSchemas.oneOf}}{{/mappedModels}}{{/oneOf.isEmpty}} + {{/oneOf}}{{^oneOf.isEmpty}}{{#composedSchemas.oneOf}}{{#-first}}Self::{{{name}}}(Box::default()){{/-first}}{{/composedSchemas.oneOf}}{{/oneOf.isEmpty}} } } diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs index 8d7300058a44..4eb758b14a65 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs @@ -14,14 +14,14 @@ use crate::models; #[serde(tag = "realtype")] pub enum CreateStateRequest { #[serde(rename="a-type")] - ObjA(Box), + AType(Box), #[serde(rename="b-type")] - ObjB(Box), + BType(Box), } impl Default for CreateStateRequest { fn default() -> Self { - Self::ObjA(Box::default()) + Self::AType(Box::default()) } } diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs index 2b424a07b764..503c8ed7a95c 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs @@ -14,16 +14,16 @@ use crate::models; #[serde(tag = "realtype")] pub enum CustomOneOfArraySchemaInner { #[serde(rename="a-type")] - ObjA(Box), + AType(Box), #[serde(rename="b-type")] - ObjB(Box), + BType(Box), #[serde(rename="c-type")] - ObjC(Box), + CType(Box), } impl Default for CustomOneOfArraySchemaInner { fn default() -> Self { - Self::ObjA(Box::default()) + Self::AType(Box::default()) } } diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs index fd9844a8e2d0..3994d32121bc 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs @@ -14,14 +14,14 @@ use crate::models; #[serde(tag = "realtype")] pub enum CustomOneOfSchema { #[serde(rename="a-type")] - ObjA(Box), + AType(Box), #[serde(rename="b-type")] - ObjB(Box), + BType(Box), } impl Default for CustomOneOfSchema { fn default() -> Self { - Self::ObjA(Box::default()) + Self::AType(Box::default()) } } diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs index 94b4d6686368..f7d7d6063018 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs @@ -14,16 +14,16 @@ use crate::models; #[serde(tag = "realtype")] pub enum GetState200Response { #[serde(rename="a-type")] - ObjA(Box), + AType(Box), #[serde(rename="b-type")] - ObjB(Box), + BType(Box), #[serde(rename="d-type")] - ObjD(Box), + DType(Box), } impl Default for GetState200Response { fn default() -> Self { - Self::ObjA(Box::default()) + Self::AType(Box::default()) } } diff --git a/samples/client/others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs b/samples/client/others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs index e06ca7c1ffff..4b3b118785c9 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs @@ -13,7 +13,9 @@ use crate::models; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "@type")] pub enum FooRefOrValue { + #[serde(rename="Foo")] Foo(Box), + #[serde(rename="FooRef")] FooRef(Box), } diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs index 8d7300058a44..4eb758b14a65 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs @@ -14,14 +14,14 @@ use crate::models; #[serde(tag = "realtype")] pub enum CreateStateRequest { #[serde(rename="a-type")] - ObjA(Box), + AType(Box), #[serde(rename="b-type")] - ObjB(Box), + BType(Box), } impl Default for CreateStateRequest { fn default() -> Self { - Self::ObjA(Box::default()) + Self::AType(Box::default()) } } diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs index 2b424a07b764..503c8ed7a95c 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs @@ -14,16 +14,16 @@ use crate::models; #[serde(tag = "realtype")] pub enum CustomOneOfArraySchemaInner { #[serde(rename="a-type")] - ObjA(Box), + AType(Box), #[serde(rename="b-type")] - ObjB(Box), + BType(Box), #[serde(rename="c-type")] - ObjC(Box), + CType(Box), } impl Default for CustomOneOfArraySchemaInner { fn default() -> Self { - Self::ObjA(Box::default()) + Self::AType(Box::default()) } } diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs index fd9844a8e2d0..3994d32121bc 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs @@ -14,14 +14,14 @@ use crate::models; #[serde(tag = "realtype")] pub enum CustomOneOfSchema { #[serde(rename="a-type")] - ObjA(Box), + AType(Box), #[serde(rename="b-type")] - ObjB(Box), + BType(Box), } impl Default for CustomOneOfSchema { fn default() -> Self { - Self::ObjA(Box::default()) + Self::AType(Box::default()) } } diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs index 94b4d6686368..f7d7d6063018 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs @@ -14,16 +14,16 @@ use crate::models; #[serde(tag = "realtype")] pub enum GetState200Response { #[serde(rename="a-type")] - ObjA(Box), + AType(Box), #[serde(rename="b-type")] - ObjB(Box), + BType(Box), #[serde(rename="d-type")] - ObjD(Box), + DType(Box), } impl Default for GetState200Response { fn default() -> Self { - Self::ObjA(Box::default()) + Self::AType(Box::default()) } } diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref_or_value.rs b/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref_or_value.rs index e06ca7c1ffff..4b3b118785c9 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref_or_value.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref_or_value.rs @@ -13,7 +13,9 @@ use crate::models; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "@type")] pub enum FooRefOrValue { + #[serde(rename="Foo")] Foo(Box), + #[serde(rename="FooRef")] FooRef(Box), } From 26bd3b2977377ab44091d7a256f704647c311b4b Mon Sep 17 00:00:00 2001 From: Artem Medvedev Date: Wed, 21 Feb 2024 22:01:49 +0100 Subject: [PATCH 10/13] test: add test for previous change --- bin/configs/rust-hyper-oneOf-reuseRef.yaml | 8 + bin/configs/rust-reqwest-oneOf-reuseRef.yaml | 8 + .../test/resources/3_0/oneOf_reuseRef.yaml | 47 ++++ samples/client/others/rust/Cargo.lock | 28 ++ .../rust/hyper/oneOf-reuseRef/.gitignore | 3 + .../oneOf-reuseRef/.openapi-generator-ignore | 23 ++ .../oneOf-reuseRef/.openapi-generator/FILES | 20 ++ .../oneOf-reuseRef/.openapi-generator/VERSION | 1 + .../rust/hyper/oneOf-reuseRef/.travis.yml | 1 + .../rust/hyper/oneOf-reuseRef/Cargo.toml | 19 ++ .../rust/hyper/oneOf-reuseRef/README.md | 47 ++++ .../rust/hyper/oneOf-reuseRef/docs/Apple.md | 12 + .../rust/hyper/oneOf-reuseRef/docs/Banana.md | 11 + .../hyper/oneOf-reuseRef/docs/DefaultApi.md | 34 +++ .../rust/hyper/oneOf-reuseRef/docs/Fruit.md | 10 + .../rust/hyper/oneOf-reuseRef/git_push.sh | 57 +++++ .../hyper/oneOf-reuseRef/src/apis/client.rs | 24 ++ .../oneOf-reuseRef/src/apis/configuration.rs | 43 ++++ .../oneOf-reuseRef/src/apis/default_api.rs | 52 ++++ .../rust/hyper/oneOf-reuseRef/src/apis/mod.rs | 54 ++++ .../hyper/oneOf-reuseRef/src/apis/request.rs | 242 ++++++++++++++++++ .../rust/hyper/oneOf-reuseRef/src/lib.rs | 13 + .../hyper/oneOf-reuseRef/src/models/apple.rs | 29 +++ .../hyper/oneOf-reuseRef/src/models/banana.rs | 26 ++ .../hyper/oneOf-reuseRef/src/models/fruit.rs | 30 +++ .../hyper/oneOf-reuseRef/src/models/mod.rs | 6 + .../rust/reqwest/oneOf-reuseRef/.gitignore | 3 + .../oneOf-reuseRef/.openapi-generator-ignore | 23 ++ .../oneOf-reuseRef/.openapi-generator/FILES | 18 ++ .../oneOf-reuseRef/.openapi-generator/VERSION | 1 + .../rust/reqwest/oneOf-reuseRef/.travis.yml | 1 + .../rust/reqwest/oneOf-reuseRef/Cargo.toml | 17 ++ .../rust/reqwest/oneOf-reuseRef/README.md | 47 ++++ .../rust/reqwest/oneOf-reuseRef/docs/Apple.md | 12 + .../reqwest/oneOf-reuseRef/docs/Banana.md | 11 + .../reqwest/oneOf-reuseRef/docs/DefaultApi.md | 34 +++ .../rust/reqwest/oneOf-reuseRef/docs/Fruit.md | 10 + .../rust/reqwest/oneOf-reuseRef/git_push.sh | 57 +++++ .../oneOf-reuseRef/src/apis/configuration.rs | 53 ++++ .../oneOf-reuseRef/src/apis/default_api.rs | 52 ++++ .../reqwest/oneOf-reuseRef/src/apis/mod.rs | 95 +++++++ .../rust/reqwest/oneOf-reuseRef/src/lib.rs | 12 + .../oneOf-reuseRef/src/models/apple.rs | 29 +++ .../oneOf-reuseRef/src/models/banana.rs | 26 ++ .../oneOf-reuseRef/src/models/fruit.rs | 30 +++ .../reqwest/oneOf-reuseRef/src/models/mod.rs | 6 + 46 files changed, 1385 insertions(+) create mode 100644 bin/configs/rust-hyper-oneOf-reuseRef.yaml create mode 100644 bin/configs/rust-reqwest-oneOf-reuseRef.yaml create mode 100644 modules/openapi-generator/src/test/resources/3_0/oneOf_reuseRef.yaml create mode 100644 samples/client/others/rust/hyper/oneOf-reuseRef/.gitignore create mode 100644 samples/client/others/rust/hyper/oneOf-reuseRef/.openapi-generator-ignore create mode 100644 samples/client/others/rust/hyper/oneOf-reuseRef/.openapi-generator/FILES create mode 100644 samples/client/others/rust/hyper/oneOf-reuseRef/.openapi-generator/VERSION create mode 100644 samples/client/others/rust/hyper/oneOf-reuseRef/.travis.yml create mode 100644 samples/client/others/rust/hyper/oneOf-reuseRef/Cargo.toml create mode 100644 samples/client/others/rust/hyper/oneOf-reuseRef/README.md create mode 100644 samples/client/others/rust/hyper/oneOf-reuseRef/docs/Apple.md create mode 100644 samples/client/others/rust/hyper/oneOf-reuseRef/docs/Banana.md create mode 100644 samples/client/others/rust/hyper/oneOf-reuseRef/docs/DefaultApi.md create mode 100644 samples/client/others/rust/hyper/oneOf-reuseRef/docs/Fruit.md create mode 100644 samples/client/others/rust/hyper/oneOf-reuseRef/git_push.sh create mode 100644 samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/client.rs create mode 100644 samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/configuration.rs create mode 100644 samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/default_api.rs create mode 100644 samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/mod.rs create mode 100644 samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/request.rs create mode 100644 samples/client/others/rust/hyper/oneOf-reuseRef/src/lib.rs create mode 100644 samples/client/others/rust/hyper/oneOf-reuseRef/src/models/apple.rs create mode 100644 samples/client/others/rust/hyper/oneOf-reuseRef/src/models/banana.rs create mode 100644 samples/client/others/rust/hyper/oneOf-reuseRef/src/models/fruit.rs create mode 100644 samples/client/others/rust/hyper/oneOf-reuseRef/src/models/mod.rs create mode 100644 samples/client/others/rust/reqwest/oneOf-reuseRef/.gitignore create mode 100644 samples/client/others/rust/reqwest/oneOf-reuseRef/.openapi-generator-ignore create mode 100644 samples/client/others/rust/reqwest/oneOf-reuseRef/.openapi-generator/FILES create mode 100644 samples/client/others/rust/reqwest/oneOf-reuseRef/.openapi-generator/VERSION create mode 100644 samples/client/others/rust/reqwest/oneOf-reuseRef/.travis.yml create mode 100644 samples/client/others/rust/reqwest/oneOf-reuseRef/Cargo.toml create mode 100644 samples/client/others/rust/reqwest/oneOf-reuseRef/README.md create mode 100644 samples/client/others/rust/reqwest/oneOf-reuseRef/docs/Apple.md create mode 100644 samples/client/others/rust/reqwest/oneOf-reuseRef/docs/Banana.md create mode 100644 samples/client/others/rust/reqwest/oneOf-reuseRef/docs/DefaultApi.md create mode 100644 samples/client/others/rust/reqwest/oneOf-reuseRef/docs/Fruit.md create mode 100644 samples/client/others/rust/reqwest/oneOf-reuseRef/git_push.sh create mode 100644 samples/client/others/rust/reqwest/oneOf-reuseRef/src/apis/configuration.rs create mode 100644 samples/client/others/rust/reqwest/oneOf-reuseRef/src/apis/default_api.rs create mode 100644 samples/client/others/rust/reqwest/oneOf-reuseRef/src/apis/mod.rs create mode 100644 samples/client/others/rust/reqwest/oneOf-reuseRef/src/lib.rs create mode 100644 samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/apple.rs create mode 100644 samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/banana.rs create mode 100644 samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/fruit.rs create mode 100644 samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/mod.rs diff --git a/bin/configs/rust-hyper-oneOf-reuseRef.yaml b/bin/configs/rust-hyper-oneOf-reuseRef.yaml new file mode 100644 index 000000000000..2d0e7ac6b0fe --- /dev/null +++ b/bin/configs/rust-hyper-oneOf-reuseRef.yaml @@ -0,0 +1,8 @@ +generatorName: rust +outputDir: samples/client/others/rust/hyper/oneOf-reuseRef +library: hyper +inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf_reuseRef.yaml +templateDir: modules/openapi-generator/src/main/resources/rust +additionalProperties: + supportAsync: false + packageName: oneof-reuse-ref-hyper diff --git a/bin/configs/rust-reqwest-oneOf-reuseRef.yaml b/bin/configs/rust-reqwest-oneOf-reuseRef.yaml new file mode 100644 index 000000000000..155e18d40407 --- /dev/null +++ b/bin/configs/rust-reqwest-oneOf-reuseRef.yaml @@ -0,0 +1,8 @@ +generatorName: rust +outputDir: samples/client/others/rust/reqwest/oneOf-reuseRef +library: reqwest +inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf_reuseRef.yaml +templateDir: modules/openapi-generator/src/main/resources/rust +additionalProperties: + supportAsync: false + packageName: oneof-reuse-ref-reqwest diff --git a/modules/openapi-generator/src/test/resources/3_0/oneOf_reuseRef.yaml b/modules/openapi-generator/src/test/resources/3_0/oneOf_reuseRef.yaml new file mode 100644 index 000000000000..a3a496ab321a --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/oneOf_reuseRef.yaml @@ -0,0 +1,47 @@ +openapi: 3.0.1 +info: + version: 1.0.0 + title: Example + license: + name: MIT +servers: + - url: http://api.example.xyz/v1 +paths: + /example: + get: + operationId: get_fruit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/Fruit" +components: + schemas: + Apple: + type: object + properties: + cultivar: + type: string + pattern: ^[a-zA-Z\s]*$ + origin: + type: string + pattern: /^[A-Z\s]*$/i + nullable: true + Banana: + type: object + properties: + lengthCm: + type: number + Fruit: + oneOf: + - $ref: '#/components/schemas/Apple' + - $ref: '#/components/schemas/Apple' + - $ref: '#/components/schemas/Banana' + discriminator: + propertyName: fruitType + mapping: + green_apple: '#/components/schemas/Apple' + banana: '#/components/schemas/Banana' + red_apple: '#/components/schemas/Apple' diff --git a/samples/client/others/rust/Cargo.lock b/samples/client/others/rust/Cargo.lock index fd0e7be93694..ffd8a31c87fb 100644 --- a/samples/client/others/rust/Cargo.lock +++ b/samples/client/others/rust/Cargo.lock @@ -671,6 +671,34 @@ dependencies = [ "uuid", ] +[[package]] +name = "oneof-reuse-ref-hyper" +version = "1.0.0" +dependencies = [ + "base64 0.7.0", + "futures", + "http", + "hyper", + "hyper-tls", + "serde", + "serde_derive", + "serde_json", + "url", + "uuid", +] + +[[package]] +name = "oneof-reuse-ref-reqwest" +version = "1.0.0" +dependencies = [ + "reqwest", + "serde", + "serde_derive", + "serde_json", + "url", + "uuid", +] + [[package]] name = "openssl" version = "0.10.55" diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/.gitignore b/samples/client/others/rust/hyper/oneOf-reuseRef/.gitignore new file mode 100644 index 000000000000..6aa106405a4b --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/.openapi-generator-ignore b/samples/client/others/rust/hyper/oneOf-reuseRef/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/.openapi-generator/FILES b/samples/client/others/rust/hyper/oneOf-reuseRef/.openapi-generator/FILES new file mode 100644 index 000000000000..b4995c6c8c17 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/.openapi-generator/FILES @@ -0,0 +1,20 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +Cargo.toml +README.md +docs/Apple.md +docs/Banana.md +docs/DefaultApi.md +docs/Fruit.md +git_push.sh +src/apis/client.rs +src/apis/configuration.rs +src/apis/default_api.rs +src/apis/mod.rs +src/apis/request.rs +src/lib.rs +src/models/apple.rs +src/models/banana.rs +src/models/fruit.rs +src/models/mod.rs diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/.openapi-generator/VERSION b/samples/client/others/rust/hyper/oneOf-reuseRef/.openapi-generator/VERSION new file mode 100644 index 000000000000..c9e125ba1880 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.4.0-SNAPSHOT diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/.travis.yml b/samples/client/others/rust/hyper/oneOf-reuseRef/.travis.yml new file mode 100644 index 000000000000..22761ba7ee19 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/Cargo.toml b/samples/client/others/rust/hyper/oneOf-reuseRef/Cargo.toml new file mode 100644 index 000000000000..60cde076e1bf --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "oneof-reuse-ref-hyper" +version = "1.0.0" +authors = ["OpenAPI Generator team and contributors"] +description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)" +license = "MIT" +edition = "2018" + +[dependencies] +serde = "^1.0" +serde_derive = "^1.0" +serde_json = "^1.0" +url = "^2.2" +uuid = { version = "^1.0", features = ["serde", "v4"] } +hyper = { version = "~0.14", features = ["full"] } +hyper-tls = "~0.5" +http = "~0.2" +base64 = "~0.7.0" +futures = "^0.3" diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/README.md b/samples/client/others/rust/hyper/oneOf-reuseRef/README.md new file mode 100644 index 000000000000..7e1b1fbe45e5 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/README.md @@ -0,0 +1,47 @@ +# Rust API client for oneof-reuse-ref-hyper + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: 1.0.0 +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `oneof-reuse-ref-hyper` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +oneof-reuse-ref-hyper = { path = "./oneof-reuse-ref-hyper" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://api.example.xyz/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**get_fruit**](docs/DefaultApi.md#get_fruit) | **Get** /example | + + +## Documentation For Models + + - [Apple](docs/Apple.md) + - [Banana](docs/Banana.md) + - [Fruit](docs/Fruit.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + + + diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/docs/Apple.md b/samples/client/others/rust/hyper/oneOf-reuseRef/docs/Apple.md new file mode 100644 index 000000000000..c7fe02804238 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/docs/Apple.md @@ -0,0 +1,12 @@ +# Apple + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cultivar** | Option<**String**> | | [optional] +**origin** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/docs/Banana.md b/samples/client/others/rust/hyper/oneOf-reuseRef/docs/Banana.md new file mode 100644 index 000000000000..46ac2e6c5849 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/docs/Banana.md @@ -0,0 +1,11 @@ +# Banana + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length_cm** | Option<**f64**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/docs/DefaultApi.md b/samples/client/others/rust/hyper/oneOf-reuseRef/docs/DefaultApi.md new file mode 100644 index 000000000000..a7172af03a6d --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/docs/DefaultApi.md @@ -0,0 +1,34 @@ +# \DefaultApi + +All URIs are relative to *http://api.example.xyz/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_fruit**](DefaultApi.md#get_fruit) | **Get** /example | + + + +## get_fruit + +> models::Fruit get_fruit() + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::Fruit**](Fruit.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/docs/Fruit.md b/samples/client/others/rust/hyper/oneOf-reuseRef/docs/Fruit.md new file mode 100644 index 000000000000..2dc45b5e5ad6 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/docs/Fruit.md @@ -0,0 +1,10 @@ +# Fruit + +## Enum Variants + +| Name | Value | +|---- | -----| + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/git_push.sh b/samples/client/others/rust/hyper/oneOf-reuseRef/git_push.sh new file mode 100644 index 000000000000..f53a75d4fabe --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/client.rs b/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/client.rs new file mode 100644 index 000000000000..021112f848c8 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/client.rs @@ -0,0 +1,24 @@ +use std::rc::Rc; + +use hyper; +use super::configuration::Configuration; + +pub struct APIClient { + default_api: Box, +} + +impl APIClient { + pub fn new(configuration: Configuration) -> APIClient + where C: Clone + std::marker::Send + Sync + 'static { + let rc = Rc::new(configuration); + + APIClient { + default_api: Box::new(crate::apis::DefaultApiClient::new(rc.clone())), + } + } + + pub fn default_api(&self) -> &dyn crate::apis::DefaultApi{ + self.default_api.as_ref() + } + +} diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/configuration.rs b/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/configuration.rs new file mode 100644 index 000000000000..fdbc91ffdf02 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/configuration.rs @@ -0,0 +1,43 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use hyper; + +pub struct Configuration + where C: Clone + std::marker::Send + Sync + 'static { + pub base_path: String, + pub user_agent: Option, + pub client: hyper::client::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub api_key: Option, + // TODO: take an oauth2 token source, similar to the go one +} + +pub type BasicAuth = (String, Option); + +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + +impl Configuration + where C: Clone + std::marker::Send + Sync { + pub fn new(client: hyper::client::Client) -> Configuration { + Configuration { + base_path: "http://api.example.xyz/v1".to_owned(), + user_agent: Some("OpenAPI-Generator/1.0.0/rust".to_owned()), + client, + basic_auth: None, + oauth_access_token: None, + api_key: None, + } + } +} diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/default_api.rs b/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/default_api.rs new file mode 100644 index 000000000000..9e2ede9bb934 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/default_api.rs @@ -0,0 +1,52 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use std::rc::Rc; +use std::borrow::Borrow; +use std::pin::Pin; +#[allow(unused_imports)] +use std::option::Option; + +use hyper; +use futures::Future; + +use crate::models; +use super::{Error, configuration}; +use super::request as __internal_request; + +pub struct DefaultApiClient + where C: Clone + std::marker::Send + Sync + 'static { + configuration: Rc>, +} + +impl DefaultApiClient + where C: Clone + std::marker::Send + Sync { + pub fn new(configuration: Rc>) -> DefaultApiClient { + DefaultApiClient { + configuration, + } + } +} + +pub trait DefaultApi { + fn get_fruit(&self, ) -> Pin>>>; +} + +implDefaultApi for DefaultApiClient + where C: Clone + std::marker::Send + Sync { + #[allow(unused_mut)] + fn get_fruit(&self, ) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::GET, "/example".to_string()) + ; + + req.execute(self.configuration.borrow()) + } + +} diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/mod.rs b/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/mod.rs new file mode 100644 index 000000000000..1a5b2f58e4b9 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/mod.rs @@ -0,0 +1,54 @@ +use http; +use hyper; +use serde_json; + +#[derive(Debug)] +pub enum Error { + Api(ApiError), + Header(hyper::http::header::InvalidHeaderValue), + Http(http::Error), + Hyper(hyper::Error), + Serde(serde_json::Error), + UriError(http::uri::InvalidUri), +} + +#[derive(Debug)] +pub struct ApiError { + pub code: hyper::StatusCode, + pub body: hyper::body::Body, +} + +impl From<(hyper::StatusCode, hyper::body::Body)> for Error { + fn from(e: (hyper::StatusCode, hyper::body::Body)) -> Self { + Error::Api(ApiError { + code: e.0, + body: e.1, + }) + } +} + +impl From for Error { + fn from(e: http::Error) -> Self { + return Error::Http(e) + } +} + +impl From for Error { + fn from(e: hyper::Error) -> Self { + return Error::Hyper(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + return Error::Serde(e) + } +} + +mod request; + +mod default_api; +pub use self::default_api::{ DefaultApi, DefaultApiClient }; + +pub mod configuration; +pub mod client; diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/request.rs b/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/request.rs new file mode 100644 index 000000000000..db4d55e47b1e --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/request.rs @@ -0,0 +1,242 @@ +use std::collections::HashMap; +use std::pin::Pin; + +use futures; +use futures::Future; +use futures::future::*; +use hyper; +use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, HeaderValue, USER_AGENT}; +use serde; +use serde_json; + +use super::{configuration, Error}; + +pub(crate) struct ApiKey { + pub in_header: bool, + pub in_query: bool, + pub param_name: String, +} + +impl ApiKey { + fn key(&self, prefix: &Option, key: &str) -> String { + match prefix { + None => key.to_owned(), + Some(ref prefix) => format!("{} {}", prefix, key), + } + } +} + +#[allow(dead_code)] +pub(crate) enum Auth { + None, + ApiKey(ApiKey), + Basic, + Oauth, +} + +/// If the authorization type is unspecified then it will be automatically detected based +/// on the configuration. This functionality is useful when the OpenAPI definition does not +/// include an authorization scheme. +pub(crate) struct Request { + auth: Option, + method: hyper::Method, + path: String, + query_params: HashMap, + no_return_type: bool, + path_params: HashMap, + form_params: HashMap, + header_params: HashMap, + // TODO: multiple body params are possible technically, but not supported here. + serialized_body: Option, +} + +#[allow(dead_code)] +impl Request { + pub fn new(method: hyper::Method, path: String) -> Self { + Request { + auth: None, + method, + path, + query_params: HashMap::new(), + path_params: HashMap::new(), + form_params: HashMap::new(), + header_params: HashMap::new(), + serialized_body: None, + no_return_type: false, + } + } + + pub fn with_body_param(mut self, param: T) -> Self { + self.serialized_body = Some(serde_json::to_string(¶m).unwrap()); + self + } + + pub fn with_header_param(mut self, basename: String, param: String) -> Self { + self.header_params.insert(basename, param); + self + } + + #[allow(unused)] + pub fn with_query_param(mut self, basename: String, param: String) -> Self { + self.query_params.insert(basename, param); + self + } + + #[allow(unused)] + pub fn with_path_param(mut self, basename: String, param: String) -> Self { + self.path_params.insert(basename, param); + self + } + + #[allow(unused)] + pub fn with_form_param(mut self, basename: String, param: String) -> Self { + self.form_params.insert(basename, param); + self + } + + pub fn returns_nothing(mut self) -> Self { + self.no_return_type = true; + self + } + + pub fn with_auth(mut self, auth: Auth) -> Self { + self.auth = Some(auth); + self + } + + pub fn execute<'a, C, U>( + self, + conf: &configuration::Configuration, + ) -> Pin> + 'a>> + where + C: hyper::client::connect::Connect + Clone + std::marker::Send + Sync, + U: Sized + std::marker::Send + 'a, + for<'de> U: serde::Deserialize<'de>, + { + let mut query_string = ::url::form_urlencoded::Serializer::new("".to_owned()); + + let mut path = self.path; + for (k, v) in self.path_params { + // replace {id} with the value of the id path param + path = path.replace(&format!("{{{}}}", k), &v); + } + + for (key, val) in self.query_params { + query_string.append_pair(&key, &val); + } + + let mut uri_str = format!("{}{}", conf.base_path, path); + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri_str += "?"; + uri_str += &query_string_str; + } + let uri: hyper::Uri = match uri_str.parse() { + Err(e) => return Box::pin(futures::future::err(Error::UriError(e))), + Ok(u) => u, + }; + + let mut req_builder = hyper::Request::builder() + .uri(uri) + .method(self.method); + + // Detect the authorization type if it hasn't been set. + let auth = self.auth.unwrap_or_else(|| + if conf.api_key.is_some() { + panic!("Cannot automatically set the API key from the configuration, it must be specified in the OpenAPI definition") + } else if conf.oauth_access_token.is_some() { + Auth::Oauth + } else if conf.basic_auth.is_some() { + Auth::Basic + } else { + Auth::None + } + ); + match auth { + Auth::ApiKey(apikey) => { + if let Some(ref key) = conf.api_key { + let val = apikey.key(&key.prefix, &key.key); + if apikey.in_query { + query_string.append_pair(&apikey.param_name, &val); + } + if apikey.in_header { + req_builder = req_builder.header(&apikey.param_name, val); + } + } + } + Auth::Basic => { + if let Some(ref auth_conf) = conf.basic_auth { + let mut text = auth_conf.0.clone(); + text.push(':'); + if let Some(ref pass) = auth_conf.1 { + text.push_str(&pass[..]); + } + let encoded = base64::encode(&text); + req_builder = req_builder.header(AUTHORIZATION, encoded); + } + } + Auth::Oauth => { + if let Some(ref token) = conf.oauth_access_token { + let text = "Bearer ".to_owned() + token; + req_builder = req_builder.header(AUTHORIZATION, text); + } + } + Auth::None => {} + } + + if let Some(ref user_agent) = conf.user_agent { + req_builder = req_builder.header(USER_AGENT, match HeaderValue::from_str(user_agent) { + Ok(header_value) => header_value, + Err(e) => return Box::pin(futures::future::err(super::Error::Header(e))) + }); + } + + for (k, v) in self.header_params { + req_builder = req_builder.header(&k, v); + } + + let req_headers = req_builder.headers_mut().unwrap(); + let request_result = if self.form_params.len() > 0 { + req_headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/x-www-form-urlencoded")); + let mut enc = ::url::form_urlencoded::Serializer::new("".to_owned()); + for (k, v) in self.form_params { + enc.append_pair(&k, &v); + } + req_builder.body(hyper::Body::from(enc.finish())) + } else if let Some(body) = self.serialized_body { + req_headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/json")); + req_headers.insert(CONTENT_LENGTH, body.len().into()); + req_builder.body(hyper::Body::from(body)) + } else { + req_builder.body(hyper::Body::default()) + }; + let request = match request_result { + Ok(request) => request, + Err(e) => return Box::pin(futures::future::err(Error::from(e))) + }; + + let no_return_type = self.no_return_type; + Box::pin(conf.client + .request(request) + .map_err(|e| Error::from(e)) + .and_then(move |response| { + let status = response.status(); + if !status.is_success() { + futures::future::err::(Error::from((status, response.into_body()))).boxed() + } else if no_return_type { + // This is a hack; if there's no_ret_type, U is (), but serde_json gives an + // error when deserializing "" into (), so deserialize 'null' into it + // instead. + // An alternate option would be to require U: Default, and then return + // U::default() here instead since () implements that, but then we'd + // need to impl default for all models. + futures::future::ok::(serde_json::from_str("null").expect("serde null value")).boxed() + } else { + hyper::body::to_bytes(response.into_body()) + .map(|bytes| serde_json::from_slice(&bytes.unwrap())) + .map_err(|e| Error::from(e)).boxed() + } + })) + } +} diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/src/lib.rs b/samples/client/others/rust/hyper/oneOf-reuseRef/src/lib.rs new file mode 100644 index 000000000000..b49043ca0402 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/src/lib.rs @@ -0,0 +1,13 @@ +#![allow(unused_imports)] + +#[macro_use] +extern crate serde_derive; + +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate hyper; +extern crate futures; + +pub mod apis; +pub mod models; diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/apple.rs b/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/apple.rs new file mode 100644 index 000000000000..72586e604716 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/apple.rs @@ -0,0 +1,29 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Apple { + #[serde(rename = "cultivar", skip_serializing_if = "Option::is_none")] + pub cultivar: Option, + #[serde(rename = "origin", skip_serializing_if = "Option::is_none")] + pub origin: Option, +} + +impl Apple { + pub fn new() -> Apple { + Apple { + cultivar: None, + origin: None, + } + } +} + diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/banana.rs b/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/banana.rs new file mode 100644 index 000000000000..b3dfb65a245d --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/banana.rs @@ -0,0 +1,26 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Banana { + #[serde(rename = "lengthCm", skip_serializing_if = "Option::is_none")] + pub length_cm: Option, +} + +impl Banana { + pub fn new() -> Banana { + Banana { + length_cm: None, + } + } +} + diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/fruit.rs b/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/fruit.rs new file mode 100644 index 000000000000..3b207d0c6401 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/fruit.rs @@ -0,0 +1,30 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(tag = "fruitType")] +pub enum Fruit { + #[serde(rename="green_apple")] + GreenApple(Box), + #[serde(rename="red_apple")] + RedApple(Box), + #[serde(rename="banana")] + Banana(Box), +} + +impl Default for Fruit { + fn default() -> Self { + Self::GreenApple(Box::default()) + } +} + + diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/mod.rs b/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/mod.rs new file mode 100644 index 000000000000..8aae2d202af5 --- /dev/null +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/mod.rs @@ -0,0 +1,6 @@ +pub mod apple; +pub use self::apple::Apple; +pub mod banana; +pub use self::banana::Banana; +pub mod fruit; +pub use self::fruit::Fruit; diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/.gitignore b/samples/client/others/rust/reqwest/oneOf-reuseRef/.gitignore new file mode 100644 index 000000000000..6aa106405a4b --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/.openapi-generator-ignore b/samples/client/others/rust/reqwest/oneOf-reuseRef/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/.openapi-generator/FILES b/samples/client/others/rust/reqwest/oneOf-reuseRef/.openapi-generator/FILES new file mode 100644 index 000000000000..35bb9b403b39 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/.openapi-generator/FILES @@ -0,0 +1,18 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +Cargo.toml +README.md +docs/Apple.md +docs/Banana.md +docs/DefaultApi.md +docs/Fruit.md +git_push.sh +src/apis/configuration.rs +src/apis/default_api.rs +src/apis/mod.rs +src/lib.rs +src/models/apple.rs +src/models/banana.rs +src/models/fruit.rs +src/models/mod.rs diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/.openapi-generator/VERSION b/samples/client/others/rust/reqwest/oneOf-reuseRef/.openapi-generator/VERSION new file mode 100644 index 000000000000..c9e125ba1880 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.4.0-SNAPSHOT diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/.travis.yml b/samples/client/others/rust/reqwest/oneOf-reuseRef/.travis.yml new file mode 100644 index 000000000000..22761ba7ee19 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/Cargo.toml b/samples/client/others/rust/reqwest/oneOf-reuseRef/Cargo.toml new file mode 100644 index 000000000000..4c98b3374252 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "oneof-reuse-ref-reqwest" +version = "1.0.0" +authors = ["OpenAPI Generator team and contributors"] +description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)" +license = "MIT" +edition = "2018" + +[dependencies] +serde = "^1.0" +serde_derive = "^1.0" +serde_json = "^1.0" +url = "^2.2" +uuid = { version = "^1.0", features = ["serde", "v4"] } +[dependencies.reqwest] +version = "^0.11" +features = ["json", "blocking", "multipart"] diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/README.md b/samples/client/others/rust/reqwest/oneOf-reuseRef/README.md new file mode 100644 index 000000000000..7316399d3bb4 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/README.md @@ -0,0 +1,47 @@ +# Rust API client for oneof-reuse-ref-reqwest + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: 1.0.0 +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `oneof-reuse-ref-reqwest` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +oneof-reuse-ref-reqwest = { path = "./oneof-reuse-ref-reqwest" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://api.example.xyz/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**get_fruit**](docs/DefaultApi.md#get_fruit) | **GET** /example | + + +## Documentation For Models + + - [Apple](docs/Apple.md) + - [Banana](docs/Banana.md) + - [Fruit](docs/Fruit.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + + + diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/docs/Apple.md b/samples/client/others/rust/reqwest/oneOf-reuseRef/docs/Apple.md new file mode 100644 index 000000000000..c7fe02804238 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/docs/Apple.md @@ -0,0 +1,12 @@ +# Apple + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cultivar** | Option<**String**> | | [optional] +**origin** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/docs/Banana.md b/samples/client/others/rust/reqwest/oneOf-reuseRef/docs/Banana.md new file mode 100644 index 000000000000..46ac2e6c5849 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/docs/Banana.md @@ -0,0 +1,11 @@ +# Banana + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length_cm** | Option<**f64**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/docs/DefaultApi.md b/samples/client/others/rust/reqwest/oneOf-reuseRef/docs/DefaultApi.md new file mode 100644 index 000000000000..eb640fcd8847 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/docs/DefaultApi.md @@ -0,0 +1,34 @@ +# \DefaultApi + +All URIs are relative to *http://api.example.xyz/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_fruit**](DefaultApi.md#get_fruit) | **GET** /example | + + + +## get_fruit + +> models::Fruit get_fruit() + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::Fruit**](Fruit.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/docs/Fruit.md b/samples/client/others/rust/reqwest/oneOf-reuseRef/docs/Fruit.md new file mode 100644 index 000000000000..2dc45b5e5ad6 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/docs/Fruit.md @@ -0,0 +1,10 @@ +# Fruit + +## Enum Variants + +| Name | Value | +|---- | -----| + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/git_push.sh b/samples/client/others/rust/reqwest/oneOf-reuseRef/git_push.sh new file mode 100644 index 000000000000..f53a75d4fabe --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/src/apis/configuration.rs b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/apis/configuration.rs new file mode 100644 index 000000000000..4dc1cd54751d --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/apis/configuration.rs @@ -0,0 +1,53 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::blocking::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, + // TODO: take an oauth2 token source, similar to the go one +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "http://api.example.xyz/v1".to_owned(), + user_agent: Some("OpenAPI-Generator/1.0.0/rust".to_owned()), + client: reqwest::blocking::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + + } + } +} diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/src/apis/default_api.rs b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/apis/default_api.rs new file mode 100644 index 000000000000..c0d92bc1e7eb --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/apis/default_api.rs @@ -0,0 +1,52 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; + +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`get_fruit`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetFruitError { + UnknownValue(serde_json::Value), +} + + +pub fn get_fruit(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/example", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req)?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text()?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/src/apis/mod.rs b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/apis/mod.rs new file mode 100644 index 000000000000..4b09ba50b401 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/apis/mod.rs @@ -0,0 +1,95 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +pub mod default_api; + +pub mod configuration; diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/src/lib.rs b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/lib.rs new file mode 100644 index 000000000000..1ac114198fdd --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/lib.rs @@ -0,0 +1,12 @@ +#![allow(unused_imports)] + +#[macro_use] +extern crate serde_derive; + +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/apple.rs b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/apple.rs new file mode 100644 index 000000000000..72586e604716 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/apple.rs @@ -0,0 +1,29 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Apple { + #[serde(rename = "cultivar", skip_serializing_if = "Option::is_none")] + pub cultivar: Option, + #[serde(rename = "origin", skip_serializing_if = "Option::is_none")] + pub origin: Option, +} + +impl Apple { + pub fn new() -> Apple { + Apple { + cultivar: None, + origin: None, + } + } +} + diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/banana.rs b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/banana.rs new file mode 100644 index 000000000000..b3dfb65a245d --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/banana.rs @@ -0,0 +1,26 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Banana { + #[serde(rename = "lengthCm", skip_serializing_if = "Option::is_none")] + pub length_cm: Option, +} + +impl Banana { + pub fn new() -> Banana { + Banana { + length_cm: None, + } + } +} + diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/fruit.rs b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/fruit.rs new file mode 100644 index 000000000000..3b207d0c6401 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/fruit.rs @@ -0,0 +1,30 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(tag = "fruitType")] +pub enum Fruit { + #[serde(rename="green_apple")] + GreenApple(Box), + #[serde(rename="red_apple")] + RedApple(Box), + #[serde(rename="banana")] + Banana(Box), +} + +impl Default for Fruit { + fn default() -> Self { + Self::GreenApple(Box::default()) + } +} + + diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/mod.rs b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/mod.rs new file mode 100644 index 000000000000..8aae2d202af5 --- /dev/null +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/mod.rs @@ -0,0 +1,6 @@ +pub mod apple; +pub use self::apple::Apple; +pub mod banana; +pub use self::banana::Banana; +pub mod fruit; +pub use self::fruit::Fruit; From 8c8b1c92926b3ca6202fd625352bdef14ce7dba0 Mon Sep 17 00:00:00 2001 From: Artem Medvedev Date: Wed, 21 Feb 2024 22:12:47 +0100 Subject: [PATCH 11/13] style: remove extra qualified path to models --- .../src/main/resources/rust/hyper/api.mustache | 4 ++-- .../src/main/resources/rust/reqwest/api.mustache | 4 ++-- .../rust/hyper/composed-oneof/src/apis/default_api.rs | 4 ++-- .../rust/hyper/oneOf-reuseRef/.openapi-generator/FILES | 1 - .../client/others/rust/hyper/oneOf/src/apis/bar_api.rs | 4 ++-- .../client/others/rust/hyper/oneOf/src/apis/foo_api.rs | 4 ++-- .../rust/reqwest/composed-oneof/src/apis/default_api.rs | 2 +- .../rust/reqwest/oneOf-reuseRef/.openapi-generator/FILES | 1 - .../client/others/rust/reqwest/oneOf/src/apis/bar_api.rs | 2 +- .../client/others/rust/reqwest/oneOf/src/apis/foo_api.rs | 2 +- .../petstore/rust/hyper/petstore/src/apis/pet_api.rs | 8 ++++---- .../petstore/rust/hyper/petstore/src/apis/store_api.rs | 4 ++-- .../petstore/rust/hyper/petstore/src/apis/user_api.rs | 8 ++++---- .../reqwest/petstore-async-middleware/src/apis/pet_api.rs | 4 ++-- .../petstore-async-middleware/src/apis/store_api.rs | 2 +- .../petstore-async-middleware/src/apis/user_api.rs | 4 ++-- .../rust/reqwest/petstore-async/src/apis/pet_api.rs | 4 ++-- .../rust/reqwest/petstore-async/src/apis/store_api.rs | 2 +- .../rust/reqwest/petstore-async/src/apis/user_api.rs | 4 ++-- .../reqwest/petstore-awsv4signature/src/apis/pet_api.rs | 4 ++-- .../reqwest/petstore-awsv4signature/src/apis/store_api.rs | 2 +- .../reqwest/petstore-awsv4signature/src/apis/user_api.rs | 4 ++-- .../petstore/rust/reqwest/petstore/src/apis/pet_api.rs | 4 ++-- .../petstore/rust/reqwest/petstore/src/apis/store_api.rs | 2 +- .../petstore/rust/reqwest/petstore/src/apis/user_api.rs | 4 ++-- 25 files changed, 43 insertions(+), 45 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/rust/hyper/api.mustache b/modules/openapi-generator/src/main/resources/rust/hyper/api.mustache index 57d9e9af5c8b..f59705ea7b72 100644 --- a/modules/openapi-generator/src/main/resources/rust/hyper/api.mustache +++ b/modules/openapi-generator/src/main/resources/rust/hyper/api.mustache @@ -29,7 +29,7 @@ impl {{{classname}}}Client pub trait {{{classname}}} { {{#operations}} {{#operation}} - fn {{{operationId}}}(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{^isUuid}}&str{{/isUuid}}{{/isString}}{{#isUuid}}&str{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Pin>>>; + fn {{{operationId}}}(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{^isUuid}}&str{{/isUuid}}{{/isString}}{{#isUuid}}&str{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Pin>>>; {{/operation}} {{/operations}} } @@ -39,7 +39,7 @@ impl{{{classname}}} for {{{classname}}}Clien {{#operations}} {{#operation}} #[allow(unused_mut)] - fn {{{operationId}}}(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{^isUuid}}&str{{/isUuid}}{{/isString}}{{#isUuid}}&str{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Pin>>> { + fn {{{operationId}}}(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{^isUuid}}&str{{/isUuid}}{{/isString}}{{#isUuid}}&str{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::{{{httpMethod.toUpperCase}}}, "{{{path}}}".to_string()) {{#hasAuthMethods}} {{#authMethods}} diff --git a/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache b/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache index 44cae73cbaa5..4be351a7901b 100644 --- a/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache +++ b/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache @@ -17,7 +17,7 @@ pub struct {{{operationIdCamelCase}}}Params { {{#description}} /// {{{.}}} {{/description}} - pub {{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{^isUuid}}{{#isString}}{{#isArray}}Vec<{{/isArray}}String{{#isArray}}>{{/isArray}}{{/isString}}{{/isUuid}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}String{{#isArray}}>{{/isArray}}{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}{{#isBodyParam}}crate::models::{{/isBodyParam}}{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}},{{/-last}} + pub {{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{^isUuid}}{{#isString}}{{#isArray}}Vec<{{/isArray}}String{{#isArray}}>{{/isArray}}{{/isString}}{{/isUuid}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}String{{#isArray}}>{{/isArray}}{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}{{#isBodyParam}}models::{{/isBodyParam}}{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}},{{/-last}} {{#-last}} } @@ -90,7 +90,7 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration: {{/vendorExtensions.x-group-parameters}} {{^vendorExtensions.x-group-parameters}} -pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration: &configuration::Configuration, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{#isArray}}Vec<{{/isArray}}{{^isUuid}}&str{{/isUuid}}{{#isArray}}>{{/isArray}}{{/isString}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}&str{{#isArray}}>{{/isArray}}{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}{{#isBodyParam}}crate::models::{{/isBodyParam}}{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Result<{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{^supportMultipleResponses}}{{^returnType}}(){{/returnType}}{{{returnType}}}{{/supportMultipleResponses}}, Error<{{{operationIdCamelCase}}}Error>> { +pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration: &configuration::Configuration, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{#isArray}}Vec<{{/isArray}}{{^isUuid}}&str{{/isUuid}}{{#isArray}}>{{/isArray}}{{/isString}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}&str{{#isArray}}>{{/isArray}}{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}{{#isBodyParam}}models::{{/isBodyParam}}{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Result<{{#supportMultipleResponses}}ResponseContent<{{{operationIdCamelCase}}}Success>{{/supportMultipleResponses}}{{^supportMultipleResponses}}{{^returnType}}(){{/returnType}}{{{returnType}}}{{/supportMultipleResponses}}, Error<{{{operationIdCamelCase}}}Error>> { let local_var_configuration = configuration; {{/vendorExtensions.x-group-parameters}} diff --git a/samples/client/others/rust/hyper/composed-oneof/src/apis/default_api.rs b/samples/client/others/rust/hyper/composed-oneof/src/apis/default_api.rs index 2a1f81b06bf6..3db27d7c1bc6 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/apis/default_api.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/apis/default_api.rs @@ -36,14 +36,14 @@ impl DefaultApiClient } pub trait DefaultApi { - fn create_state(&self, create_state_request: crate::models::CreateStateRequest) -> Pin>>>; + fn create_state(&self, create_state_request: models::CreateStateRequest) -> Pin>>>; fn get_state(&self, ) -> Pin>>>; } implDefaultApi for DefaultApiClient where C: Clone + std::marker::Send + Sync { #[allow(unused_mut)] - fn create_state(&self, create_state_request: crate::models::CreateStateRequest) -> Pin>>> { + fn create_state(&self, create_state_request: models::CreateStateRequest) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::POST, "/state".to_string()) ; req = req.with_body_param(create_state_request); diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/.openapi-generator/FILES b/samples/client/others/rust/hyper/oneOf-reuseRef/.openapi-generator/FILES index b4995c6c8c17..0f99013bc976 100644 --- a/samples/client/others/rust/hyper/oneOf-reuseRef/.openapi-generator/FILES +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml Cargo.toml README.md diff --git a/samples/client/others/rust/hyper/oneOf/src/apis/bar_api.rs b/samples/client/others/rust/hyper/oneOf/src/apis/bar_api.rs index e3d76e9197f7..588e9451b9e0 100644 --- a/samples/client/others/rust/hyper/oneOf/src/apis/bar_api.rs +++ b/samples/client/others/rust/hyper/oneOf/src/apis/bar_api.rs @@ -36,13 +36,13 @@ impl BarApiClient } pub trait BarApi { - fn create_bar(&self, bar_create: crate::models::BarCreate) -> Pin>>>; + fn create_bar(&self, bar_create: models::BarCreate) -> Pin>>>; } implBarApi for BarApiClient where C: Clone + std::marker::Send + Sync { #[allow(unused_mut)] - fn create_bar(&self, bar_create: crate::models::BarCreate) -> Pin>>> { + fn create_bar(&self, bar_create: models::BarCreate) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::POST, "/bar".to_string()) ; req = req.with_body_param(bar_create); diff --git a/samples/client/others/rust/hyper/oneOf/src/apis/foo_api.rs b/samples/client/others/rust/hyper/oneOf/src/apis/foo_api.rs index abea506ea5b0..95cc653a9cd9 100644 --- a/samples/client/others/rust/hyper/oneOf/src/apis/foo_api.rs +++ b/samples/client/others/rust/hyper/oneOf/src/apis/foo_api.rs @@ -36,14 +36,14 @@ impl FooApiClient } pub trait FooApi { - fn create_foo(&self, foo: Option) -> Pin>>>; + fn create_foo(&self, foo: Option) -> Pin>>>; fn get_all_foos(&self, ) -> Pin, Error>>>>; } implFooApi for FooApiClient where C: Clone + std::marker::Send + Sync { #[allow(unused_mut)] - fn create_foo(&self, foo: Option) -> Pin>>> { + fn create_foo(&self, foo: Option) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::POST, "/foo".to_string()) ; req = req.with_body_param(foo); diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/apis/default_api.rs b/samples/client/others/rust/reqwest/composed-oneof/src/apis/default_api.rs index c2a02e02dcd7..03e6c12b1715 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/apis/default_api.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/apis/default_api.rs @@ -30,7 +30,7 @@ pub enum GetStateError { } -pub fn create_state(configuration: &configuration::Configuration, create_state_request: crate::models::CreateStateRequest) -> Result<(), Error> { +pub fn create_state(configuration: &configuration::Configuration, create_state_request: models::CreateStateRequest) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/.openapi-generator/FILES b/samples/client/others/rust/reqwest/oneOf-reuseRef/.openapi-generator/FILES index 35bb9b403b39..207207bf1c14 100644 --- a/samples/client/others/rust/reqwest/oneOf-reuseRef/.openapi-generator/FILES +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml Cargo.toml README.md diff --git a/samples/client/others/rust/reqwest/oneOf/src/apis/bar_api.rs b/samples/client/others/rust/reqwest/oneOf/src/apis/bar_api.rs index f110aec984cc..2d07cacdb490 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/apis/bar_api.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/apis/bar_api.rs @@ -23,7 +23,7 @@ pub enum CreateBarError { } -pub fn create_bar(configuration: &configuration::Configuration, bar_create: crate::models::BarCreate) -> Result> { +pub fn create_bar(configuration: &configuration::Configuration, bar_create: models::BarCreate) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/samples/client/others/rust/reqwest/oneOf/src/apis/foo_api.rs b/samples/client/others/rust/reqwest/oneOf/src/apis/foo_api.rs index 52098ac7232d..be07fec20089 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/apis/foo_api.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/apis/foo_api.rs @@ -30,7 +30,7 @@ pub enum GetAllFoosError { } -pub fn create_foo(configuration: &configuration::Configuration, foo: Option) -> Result> { +pub fn create_foo(configuration: &configuration::Configuration, foo: Option) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs index 3813527d3519..a81f12916812 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs @@ -36,12 +36,12 @@ impl PetApiClient } pub trait PetApi { - fn add_pet(&self, pet: crate::models::Pet) -> Pin>>>; + fn add_pet(&self, pet: models::Pet) -> Pin>>>; fn delete_pet(&self, pet_id: i64, api_key: Option<&str>) -> Pin>>>; fn find_pets_by_status(&self, status: Vec) -> Pin, Error>>>>; fn find_pets_by_tags(&self, tags: Vec) -> Pin, Error>>>>; fn get_pet_by_id(&self, pet_id: i64) -> Pin>>>; - fn update_pet(&self, pet: crate::models::Pet) -> Pin>>>; + fn update_pet(&self, pet: models::Pet) -> Pin>>>; fn update_pet_with_form(&self, pet_id: i64, name: Option<&str>, status: Option<&str>) -> Pin>>>; fn upload_file(&self, pet_id: i64, additional_metadata: Option<&str>, file: Option) -> Pin>>>; } @@ -49,7 +49,7 @@ pub trait PetApi { implPetApi for PetApiClient where C: Clone + std::marker::Send + Sync { #[allow(unused_mut)] - fn add_pet(&self, pet: crate::models::Pet) -> Pin>>> { + fn add_pet(&self, pet: models::Pet) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::POST, "/pet".to_string()) .with_auth(__internal_request::Auth::Oauth) ; @@ -107,7 +107,7 @@ implPetApi for PetApiClient } #[allow(unused_mut)] - fn update_pet(&self, pet: crate::models::Pet) -> Pin>>> { + fn update_pet(&self, pet: models::Pet) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::PUT, "/pet".to_string()) .with_auth(__internal_request::Auth::Oauth) ; diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs index c2afd7683abb..d1984b9e698c 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs @@ -39,7 +39,7 @@ pub trait StoreApi { fn delete_order(&self, order_id: &str) -> Pin>>>; fn get_inventory(&self, ) -> Pin, Error>>>>; fn get_order_by_id(&self, order_id: i64) -> Pin>>>; - fn place_order(&self, order: crate::models::Order) -> Pin>>>; + fn place_order(&self, order: models::Order) -> Pin>>>; } implStoreApi for StoreApiClient @@ -77,7 +77,7 @@ implStoreApi for StoreApiClient } #[allow(unused_mut)] - fn place_order(&self, order: crate::models::Order) -> Pin>>> { + fn place_order(&self, order: models::Order) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::POST, "/store/order".to_string()) ; req = req.with_body_param(order); diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs index ebef22602d0b..3511933ac8bb 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs @@ -36,20 +36,20 @@ impl UserApiClient } pub trait UserApi { - fn create_user(&self, user: crate::models::User) -> Pin>>>; + fn create_user(&self, user: models::User) -> Pin>>>; fn create_users_with_array_input(&self, user: Vec) -> Pin>>>; fn create_users_with_list_input(&self, user: Vec) -> Pin>>>; fn delete_user(&self, username: &str) -> Pin>>>; fn get_user_by_name(&self, username: &str) -> Pin>>>; fn login_user(&self, username: &str, password: &str) -> Pin>>>; fn logout_user(&self, ) -> Pin>>>; - fn update_user(&self, username: &str, user: crate::models::User) -> Pin>>>; + fn update_user(&self, username: &str, user: models::User) -> Pin>>>; } implUserApi for UserApiClient where C: Clone + std::marker::Send + Sync { #[allow(unused_mut)] - fn create_user(&self, user: crate::models::User) -> Pin>>> { + fn create_user(&self, user: models::User) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::POST, "/user".to_string()) .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ in_header: true, @@ -142,7 +142,7 @@ implUserApi for UserApiClient } #[allow(unused_mut)] - fn update_user(&self, username: &str, user: crate::models::User) -> Pin>>> { + fn update_user(&self, username: &str, user: models::User) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::PUT, "/user/{username}".to_string()) .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ in_header: true, diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/pet_api.rs index a881754edf61..ccdefa44be16 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/pet_api.rs @@ -18,7 +18,7 @@ use super::{Error, configuration}; #[derive(Clone, Debug)] pub struct AddPetParams { /// Pet object that needs to be added to the store - pub pet: crate::models::Pet + pub pet: models::Pet } /// struct for passing parameters to the method [`delete_pet`] @@ -54,7 +54,7 @@ pub struct GetPetByIdParams { #[derive(Clone, Debug)] pub struct UpdatePetParams { /// Pet object that needs to be added to the store - pub pet: crate::models::Pet + pub pet: models::Pet } /// struct for passing parameters to the method [`update_pet_with_form`] diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/store_api.rs index 684a12e62dd0..d08b7b74e46d 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/store_api.rs @@ -32,7 +32,7 @@ pub struct GetOrderByIdParams { #[derive(Clone, Debug)] pub struct PlaceOrderParams { /// order placed for purchasing the pet - pub order: crate::models::Order + pub order: models::Order } diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/user_api.rs index c8200a2dc84a..32594255a63e 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/user_api.rs @@ -18,7 +18,7 @@ use super::{Error, configuration}; #[derive(Clone, Debug)] pub struct CreateUserParams { /// Created user object - pub user: crate::models::User + pub user: models::User } /// struct for passing parameters to the method [`create_users_with_array_input`] @@ -64,7 +64,7 @@ pub struct UpdateUserParams { /// name that need to be deleted pub username: String, /// Updated user object - pub user: crate::models::User + pub user: models::User } diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs index a881754edf61..ccdefa44be16 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs @@ -18,7 +18,7 @@ use super::{Error, configuration}; #[derive(Clone, Debug)] pub struct AddPetParams { /// Pet object that needs to be added to the store - pub pet: crate::models::Pet + pub pet: models::Pet } /// struct for passing parameters to the method [`delete_pet`] @@ -54,7 +54,7 @@ pub struct GetPetByIdParams { #[derive(Clone, Debug)] pub struct UpdatePetParams { /// Pet object that needs to be added to the store - pub pet: crate::models::Pet + pub pet: models::Pet } /// struct for passing parameters to the method [`update_pet_with_form`] diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs index 684a12e62dd0..d08b7b74e46d 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs @@ -32,7 +32,7 @@ pub struct GetOrderByIdParams { #[derive(Clone, Debug)] pub struct PlaceOrderParams { /// order placed for purchasing the pet - pub order: crate::models::Order + pub order: models::Order } diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs index c8200a2dc84a..32594255a63e 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs @@ -18,7 +18,7 @@ use super::{Error, configuration}; #[derive(Clone, Debug)] pub struct CreateUserParams { /// Created user object - pub user: crate::models::User + pub user: models::User } /// struct for passing parameters to the method [`create_users_with_array_input`] @@ -64,7 +64,7 @@ pub struct UpdateUserParams { /// name that need to be deleted pub username: String, /// Updated user object - pub user: crate::models::User + pub user: models::User } diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/pet_api.rs index 9fe35d29c73c..ff120978fc73 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/pet_api.rs @@ -83,7 +83,7 @@ pub enum UploadFileError { /// -pub fn add_pet(configuration: &configuration::Configuration, pet: crate::models::Pet) -> Result> { +pub fn add_pet(configuration: &configuration::Configuration, pet: models::Pet) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -320,7 +320,7 @@ pub fn get_pet_by_id(configuration: &configuration::Configuration, pet_id: i64) } /// -pub fn update_pet(configuration: &configuration::Configuration, pet: crate::models::Pet) -> Result> { +pub fn update_pet(configuration: &configuration::Configuration, pet: models::Pet) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/store_api.rs index f15f14107786..3f42d04d3ece 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/store_api.rs @@ -155,7 +155,7 @@ pub fn get_order_by_id(configuration: &configuration::Configuration, order_id: i } /// -pub fn place_order(configuration: &configuration::Configuration, order: crate::models::Order) -> Result> { +pub fn place_order(configuration: &configuration::Configuration, order: models::Order) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/user_api.rs index 00b8cc7b3efa..b1f475f2a041 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/user_api.rs @@ -84,7 +84,7 @@ pub enum UpdateUserError { /// This can only be done by the logged in user. -pub fn create_user(configuration: &configuration::Configuration, user: crate::models::User) -> Result<(), Error> { +pub fn create_user(configuration: &configuration::Configuration, user: models::User) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -390,7 +390,7 @@ pub fn logout_user(configuration: &configuration::Configuration, ) -> Result<(), } /// This can only be done by the logged in user. -pub fn update_user(configuration: &configuration::Configuration, username: &str, user: crate::models::User) -> Result<(), Error> { +pub fn update_user(configuration: &configuration::Configuration, username: &str, user: models::User) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs index c8612c474397..70dec4dca247 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs @@ -83,7 +83,7 @@ pub enum UploadFileError { /// -pub fn add_pet(configuration: &configuration::Configuration, pet: crate::models::Pet) -> Result> { +pub fn add_pet(configuration: &configuration::Configuration, pet: models::Pet) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -255,7 +255,7 @@ pub fn get_pet_by_id(configuration: &configuration::Configuration, pet_id: i64) } /// -pub fn update_pet(configuration: &configuration::Configuration, pet: crate::models::Pet) -> Result> { +pub fn update_pet(configuration: &configuration::Configuration, pet: models::Pet) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs index 3ee709fcf1b4..a29eba98354e 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs @@ -142,7 +142,7 @@ pub fn get_order_by_id(configuration: &configuration::Configuration, order_id: i } /// -pub fn place_order(configuration: &configuration::Configuration, order: crate::models::Order) -> Result> { +pub fn place_order(configuration: &configuration::Configuration, order: models::Order) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs index c157f85bea14..ec400432aae8 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs @@ -84,7 +84,7 @@ pub enum UpdateUserError { /// This can only be done by the logged in user. -pub fn create_user(configuration: &configuration::Configuration, user: crate::models::User) -> Result<(), Error> { +pub fn create_user(configuration: &configuration::Configuration, user: models::User) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -325,7 +325,7 @@ pub fn logout_user(configuration: &configuration::Configuration, ) -> Result<(), } /// This can only be done by the logged in user. -pub fn update_user(configuration: &configuration::Configuration, username: &str, user: crate::models::User) -> Result<(), Error> { +pub fn update_user(configuration: &configuration::Configuration, username: &str, user: models::User) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; From cf902005bd23d329b33f7f643e22b6431340e517 Mon Sep 17 00:00:00 2001 From: Artem Medvedev Date: Wed, 21 Feb 2024 23:49:20 +0100 Subject: [PATCH 12/13] add some comments --- .../codegen/languages/RustClientCodegen.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java index fc5fb370d84d..182b573f7161 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java @@ -208,7 +208,7 @@ public RustClientCodegen() { public CodegenModel fromModel(String name, Schema model) { CodegenModel mdl = super.fromModel(name, model); - // set alias names to oneOf in composed-schema to use as enum variant names + // set correct names and baseNames to oneOf in composed-schema to use as enum variant names & mapping if (mdl.getComposedSchemas() != null && mdl.getComposedSchemas().getOneOf() != null && !mdl.getComposedSchemas().getOneOf().isEmpty()) { @@ -236,16 +236,24 @@ public CodegenModel fromModel(String name, Schema model) { Schema schema = schemas.get(i); if (mappedNamesByRef.containsKey(schema.get$ref())) { + // prefer mapped names if present + // remove mapping not in order not to reuse for the next occurance of the ref String mappedName = mappedNamesByRef.get(schema.get$ref()).removeFirst(); oneOf.setBaseName(mappedName); oneOf.setName(toModelName(mappedName)); - } else { + } else if (!org.apache.commons.lang3.StringUtils.isEmpty(schema.get$ref())) { + // use $ref if it's reference String refName = ModelUtils.getSimpleRef(schema.get$ref()); if (refName != null) { String modelName = toModelName(refName); oneOf.setName(modelName); oneOf.setBaseName(refName); } + } else { + // In-placed type (primitive), because there is no mapping or ref for it. + // use camelized `title` if present, otherwise use `type` + String oneOfName = Optional.ofNullable(schema.getTitle()).orElseGet(schema::getType); + oneOf.setName(toModelName(oneOfName)); } } From 3755d63709d4a9412d681b90222f95e30332b061 Mon Sep 17 00:00:00 2001 From: Artem Medvedev Date: Thu, 22 Feb 2024 15:42:32 +0100 Subject: [PATCH 13/13] fix(build): use method of `List` instead of specific for `LinkedList` --- .../openapitools/codegen/languages/RustClientCodegen.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java index 182b573f7161..c68b7892f760 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java @@ -237,8 +237,9 @@ public CodegenModel fromModel(String name, Schema model) { if (mappedNamesByRef.containsKey(schema.get$ref())) { // prefer mapped names if present - // remove mapping not in order not to reuse for the next occurance of the ref - String mappedName = mappedNamesByRef.get(schema.get$ref()).removeFirst(); + // remove mapping not in order not to reuse for the next occurrence of the ref + List names = mappedNamesByRef.get(schema.get$ref()); + String mappedName = names.remove(0); oneOf.setBaseName(mappedName); oneOf.setName(toModelName(mappedName)); } else if (!org.apache.commons.lang3.StringUtils.isEmpty(schema.get$ref())) {