-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[rust] Fix model constructor for required enum array (#14196)
For a required enum array property the generated model constructor used the type `RequiredEnums` instead of `Vec<RequiredEnums>`.
- Loading branch information
Showing
27 changed files
with
323 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
samples/client/petstore/rust/hyper/petstore/docs/EnumArrayTesting.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 @@ | ||
# EnumArrayTesting | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**required_enums** | **Vec<String>** | | | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
||
|
46 changes: 46 additions & 0 deletions
46
samples/client/petstore/rust/hyper/petstore/src/models/enum_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,46 @@ | ||
/* | ||
* 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 | ||
*/ | ||
|
||
/// EnumArrayTesting : Test of enum array | ||
|
||
|
||
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] | ||
pub struct EnumArrayTesting { | ||
#[serde(rename = "required_enums")] | ||
pub required_enums: Vec<RequiredEnums>, | ||
} | ||
|
||
impl EnumArrayTesting { | ||
/// Test of enum array | ||
pub fn new(required_enums: Vec<RequiredEnums>) -> EnumArrayTesting { | ||
EnumArrayTesting { | ||
required_enums, | ||
} | ||
} | ||
} | ||
|
||
/// | ||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] | ||
pub enum RequiredEnums { | ||
#[serde(rename = "A")] | ||
A, | ||
#[serde(rename = "B")] | ||
B, | ||
#[serde(rename = "C")] | ||
C, | ||
} | ||
|
||
impl Default for RequiredEnums { | ||
fn default() -> RequiredEnums { | ||
Self::A | ||
} | ||
} | ||
|
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
...client/petstore/rust/reqwest/petstore-async-middleware/docs/EnumArrayTesting.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 @@ | ||
# EnumArrayTesting | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**required_enums** | **Vec<String>** | | | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
||
|
46 changes: 46 additions & 0 deletions
46
...s/client/petstore/rust/reqwest/petstore-async-middleware/src/models/enum_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,46 @@ | ||
/* | ||
* 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 | ||
*/ | ||
|
||
/// EnumArrayTesting : Test of enum array | ||
|
||
|
||
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] | ||
pub struct EnumArrayTesting { | ||
#[serde(rename = "required_enums")] | ||
pub required_enums: Vec<RequiredEnums>, | ||
} | ||
|
||
impl EnumArrayTesting { | ||
/// Test of enum array | ||
pub fn new(required_enums: Vec<RequiredEnums>) -> EnumArrayTesting { | ||
EnumArrayTesting { | ||
required_enums, | ||
} | ||
} | ||
} | ||
|
||
/// | ||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] | ||
pub enum RequiredEnums { | ||
#[serde(rename = "A")] | ||
A, | ||
#[serde(rename = "B")] | ||
B, | ||
#[serde(rename = "C")] | ||
C, | ||
} | ||
|
||
impl Default for RequiredEnums { | ||
fn default() -> RequiredEnums { | ||
Self::A | ||
} | ||
} | ||
|
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/reqwest/petstore-async/docs/EnumArrayTesting.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 @@ | ||
# EnumArrayTesting | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**required_enums** | **Vec<String>** | | | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
||
|
46 changes: 46 additions & 0 deletions
46
samples/client/petstore/rust/reqwest/petstore-async/src/models/enum_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,46 @@ | ||
/* | ||
* 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 | ||
*/ | ||
|
||
/// EnumArrayTesting : Test of enum array | ||
|
||
|
||
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] | ||
pub struct EnumArrayTesting { | ||
#[serde(rename = "required_enums")] | ||
pub required_enums: Vec<RequiredEnums>, | ||
} | ||
|
||
impl EnumArrayTesting { | ||
/// Test of enum array | ||
pub fn new(required_enums: Vec<RequiredEnums>) -> EnumArrayTesting { | ||
EnumArrayTesting { | ||
required_enums, | ||
} | ||
} | ||
} | ||
|
||
/// | ||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] | ||
pub enum RequiredEnums { | ||
#[serde(rename = "A")] | ||
A, | ||
#[serde(rename = "B")] | ||
B, | ||
#[serde(rename = "C")] | ||
C, | ||
} | ||
|
||
impl Default for RequiredEnums { | ||
fn default() -> RequiredEnums { | ||
Self::A | ||
} | ||
} | ||
|
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
...s/client/petstore/rust/reqwest/petstore-awsv4signature/docs/EnumArrayTesting.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 @@ | ||
# EnumArrayTesting | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**required_enums** | **Vec<String>** | | | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
||
|
46 changes: 46 additions & 0 deletions
46
...les/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/enum_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,46 @@ | ||
/* | ||
* 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 | ||
*/ | ||
|
||
/// EnumArrayTesting : Test of enum array | ||
|
||
|
||
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] | ||
pub struct EnumArrayTesting { | ||
#[serde(rename = "required_enums")] | ||
pub required_enums: Vec<RequiredEnums>, | ||
} | ||
|
||
impl EnumArrayTesting { | ||
/// Test of enum array | ||
pub fn new(required_enums: Vec<RequiredEnums>) -> EnumArrayTesting { | ||
EnumArrayTesting { | ||
required_enums, | ||
} | ||
} | ||
} | ||
|
||
/// | ||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] | ||
pub enum RequiredEnums { | ||
#[serde(rename = "A")] | ||
A, | ||
#[serde(rename = "B")] | ||
B, | ||
#[serde(rename = "C")] | ||
C, | ||
} | ||
|
||
impl Default for RequiredEnums { | ||
fn default() -> RequiredEnums { | ||
Self::A | ||
} | ||
} | ||
|
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
Oops, something went wrong.