forked from OpenAPITools/openapi-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX][Rust] Array with unique enum items no longer causes mismatch…
…ed types error (OpenAPITools#17197) * check args to fn new for uniqueItems * Added model with unique items for template testing * build the project and update samples * Removed testcase from fake petstore spec
- Loading branch information
1 parent
f033b11
commit 8911740
Showing
27 changed files
with
332 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
samples/client/petstore/rust/hyper/petstore/docs/UniqueItemArrayTesting.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# UniqueItemArrayTesting | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**unique_item_array** | **Vec<String>** | Helper object for the unique item array test | | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
samples/client/petstore/rust/hyper/petstore/src/models/unique_item_array_testing.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* OpenAPI Petstore | ||
* | ||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. | ||
* | ||
* The version of the OpenAPI document: 1.0.0 | ||
* | ||
* Generated by: https://openapi-generator.tech | ||
*/ | ||
|
||
/// UniqueItemArrayTesting : Test handling of enum array with unique items | ||
|
||
|
||
|
||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] | ||
pub struct UniqueItemArrayTesting { | ||
/// Helper object for the unique item array test | ||
#[serde(rename = "unique_item_array")] | ||
pub unique_item_array: std::collections::HashSet<UniqueItemArray>, | ||
} | ||
|
||
impl UniqueItemArrayTesting { | ||
/// Test handling of enum array with unique items | ||
pub fn new(unique_item_array: std::collections::HashSet<UniqueItemArray>) -> UniqueItemArrayTesting { | ||
UniqueItemArrayTesting { | ||
unique_item_array, | ||
} | ||
} | ||
} | ||
|
||
/// Helper object for the unique item array test | ||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] | ||
pub enum UniqueItemArray { | ||
#[serde(rename = "unique_item_1")] | ||
Variant1, | ||
#[serde(rename = "unique_item_2")] | ||
Variant2, | ||
#[serde(rename = "unique_item_3")] | ||
Variant3, | ||
} | ||
|
||
impl Default for UniqueItemArray { | ||
fn default() -> UniqueItemArray { | ||
Self::Variant1 | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
.../petstore/rust/reqwest/petstore-async-middleware/docs/UniqueItemArrayTesting.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# UniqueItemArrayTesting | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**unique_item_array** | **Vec<String>** | Helper object for the unique item array test | | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...t/petstore/rust/reqwest/petstore-async-middleware/src/models/unique_item_array_testing.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* OpenAPI Petstore | ||
* | ||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. | ||
* | ||
* The version of the OpenAPI document: 1.0.0 | ||
* | ||
* Generated by: https://openapi-generator.tech | ||
*/ | ||
|
||
/// UniqueItemArrayTesting : Test handling of enum array with unique items | ||
|
||
|
||
|
||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] | ||
pub struct UniqueItemArrayTesting { | ||
/// Helper object for the unique item array test | ||
#[serde(rename = "unique_item_array")] | ||
pub unique_item_array: std::collections::HashSet<UniqueItemArray>, | ||
} | ||
|
||
impl UniqueItemArrayTesting { | ||
/// Test handling of enum array with unique items | ||
pub fn new(unique_item_array: std::collections::HashSet<UniqueItemArray>) -> UniqueItemArrayTesting { | ||
UniqueItemArrayTesting { | ||
unique_item_array, | ||
} | ||
} | ||
} | ||
|
||
/// Helper object for the unique item array test | ||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] | ||
pub enum UniqueItemArray { | ||
#[serde(rename = "unique_item_1")] | ||
Variant1, | ||
#[serde(rename = "unique_item_2")] | ||
Variant2, | ||
#[serde(rename = "unique_item_3")] | ||
Variant3, | ||
} | ||
|
||
impl Default for UniqueItemArray { | ||
fn default() -> UniqueItemArray { | ||
Self::Variant1 | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
samples/client/petstore/rust/reqwest/petstore-async/docs/UniqueItemArrayTesting.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# UniqueItemArrayTesting | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**unique_item_array** | **Vec<String>** | Helper object for the unique item array test | | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
samples/client/petstore/rust/reqwest/petstore-async/src/models/unique_item_array_testing.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* OpenAPI Petstore | ||
* | ||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. | ||
* | ||
* The version of the OpenAPI document: 1.0.0 | ||
* | ||
* Generated by: https://openapi-generator.tech | ||
*/ | ||
|
||
/// UniqueItemArrayTesting : Test handling of enum array with unique items | ||
|
||
|
||
|
||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] | ||
pub struct UniqueItemArrayTesting { | ||
/// Helper object for the unique item array test | ||
#[serde(rename = "unique_item_array")] | ||
pub unique_item_array: std::collections::HashSet<UniqueItemArray>, | ||
} | ||
|
||
impl UniqueItemArrayTesting { | ||
/// Test handling of enum array with unique items | ||
pub fn new(unique_item_array: std::collections::HashSet<UniqueItemArray>) -> UniqueItemArrayTesting { | ||
UniqueItemArrayTesting { | ||
unique_item_array, | ||
} | ||
} | ||
} | ||
|
||
/// Helper object for the unique item array test | ||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] | ||
pub enum UniqueItemArray { | ||
#[serde(rename = "unique_item_1")] | ||
Variant1, | ||
#[serde(rename = "unique_item_2")] | ||
Variant2, | ||
#[serde(rename = "unique_item_3")] | ||
Variant3, | ||
} | ||
|
||
impl Default for UniqueItemArray { | ||
fn default() -> UniqueItemArray { | ||
Self::Variant1 | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...nt/petstore/rust/reqwest/petstore-awsv4signature/docs/UniqueItemArrayTesting.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# UniqueItemArrayTesting | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**unique_item_array** | **Vec<String>** | Helper object for the unique item array test | | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...ent/petstore/rust/reqwest/petstore-awsv4signature/src/models/unique_item_array_testing.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* OpenAPI Petstore | ||
* | ||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. | ||
* | ||
* The version of the OpenAPI document: 1.0.0 | ||
* | ||
* Generated by: https://openapi-generator.tech | ||
*/ | ||
|
||
/// UniqueItemArrayTesting : Test handling of enum array with unique items | ||
|
||
|
||
|
||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] | ||
pub struct UniqueItemArrayTesting { | ||
/// Helper object for the unique item array test | ||
#[serde(rename = "unique_item_array")] | ||
pub unique_item_array: std::collections::HashSet<UniqueItemArray>, | ||
} | ||
|
||
impl UniqueItemArrayTesting { | ||
/// Test handling of enum array with unique items | ||
pub fn new(unique_item_array: std::collections::HashSet<UniqueItemArray>) -> UniqueItemArrayTesting { | ||
UniqueItemArrayTesting { | ||
unique_item_array, | ||
} | ||
} | ||
} | ||
|
||
/// Helper object for the unique item array test | ||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] | ||
pub enum UniqueItemArray { | ||
#[serde(rename = "unique_item_1")] | ||
Variant1, | ||
#[serde(rename = "unique_item_2")] | ||
Variant2, | ||
#[serde(rename = "unique_item_3")] | ||
Variant3, | ||
} | ||
|
||
impl Default for UniqueItemArray { | ||
fn default() -> UniqueItemArray { | ||
Self::Variant1 | ||
} | ||
} | ||
|
Oops, something went wrong.