-
-
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 declaration for arrays with object and array references (#…
…14198) * [rust] Fix declaration for arrays with object and array references For arrays with an item defined by reference to an array or an object, the generated type declaration was `Vec<core::models::Array>` or `Vec<core::models::Map>` without defining a `Array` or `Map` so that the code didn't compile. * [rust] Fix trailing whitespace in petstore definition
- Loading branch information
Showing
27 changed files
with
282 additions
and
7 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
12 changes: 12 additions & 0 deletions
12
samples/client/petstore/rust/hyper/petstore/docs/ArrayItemRefTest.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,12 @@ | ||
# ArrayItemRefTest | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**list_with_array_ref** | [**Vec<Vec<String>>**](array.md) | | | ||
**list_with_object_ref** | [**Vec<::std::collections::HashMap<String, serde_json::Value>>**](map.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) | ||
|
||
|
33 changes: 33 additions & 0 deletions
33
samples/client/petstore/rust/hyper/petstore/src/models/array_item_ref_test.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,33 @@ | ||
/* | ||
* 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 | ||
*/ | ||
|
||
/// ArrayItemRefTest : Test handling of object reference in arrays | ||
|
||
|
||
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] | ||
pub struct ArrayItemRefTest { | ||
#[serde(rename = "list_with_array_ref")] | ||
pub list_with_array_ref: Vec<Vec<String>>, | ||
#[serde(rename = "list_with_object_ref")] | ||
pub list_with_object_ref: Vec<::std::collections::HashMap<String, serde_json::Value>>, | ||
} | ||
|
||
impl ArrayItemRefTest { | ||
/// Test handling of object reference in arrays | ||
pub fn new(list_with_array_ref: Vec<Vec<String>>, list_with_object_ref: Vec<::std::collections::HashMap<String, serde_json::Value>>) -> ArrayItemRefTest { | ||
ArrayItemRefTest { | ||
list_with_array_ref, | ||
list_with_object_ref, | ||
} | ||
} | ||
} | ||
|
||
|
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
12 changes: 12 additions & 0 deletions
12
...client/petstore/rust/reqwest/petstore-async-middleware/docs/ArrayItemRefTest.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,12 @@ | ||
# ArrayItemRefTest | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**list_with_array_ref** | [**Vec<Vec<String>>**](array.md) | | | ||
**list_with_object_ref** | [**Vec<::std::collections::HashMap<String, serde_json::Value>>**](map.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) | ||
|
||
|
33 changes: 33 additions & 0 deletions
33
.../client/petstore/rust/reqwest/petstore-async-middleware/src/models/array_item_ref_test.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,33 @@ | ||
/* | ||
* 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 | ||
*/ | ||
|
||
/// ArrayItemRefTest : Test handling of object reference in arrays | ||
|
||
|
||
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] | ||
pub struct ArrayItemRefTest { | ||
#[serde(rename = "list_with_array_ref")] | ||
pub list_with_array_ref: Vec<Vec<String>>, | ||
#[serde(rename = "list_with_object_ref")] | ||
pub list_with_object_ref: Vec<::std::collections::HashMap<String, serde_json::Value>>, | ||
} | ||
|
||
impl ArrayItemRefTest { | ||
/// Test handling of object reference in arrays | ||
pub fn new(list_with_array_ref: Vec<Vec<String>>, list_with_object_ref: Vec<::std::collections::HashMap<String, serde_json::Value>>) -> ArrayItemRefTest { | ||
ArrayItemRefTest { | ||
list_with_array_ref, | ||
list_with_object_ref, | ||
} | ||
} | ||
} | ||
|
||
|
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
12 changes: 12 additions & 0 deletions
12
samples/client/petstore/rust/reqwest/petstore-async/docs/ArrayItemRefTest.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,12 @@ | ||
# ArrayItemRefTest | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**list_with_array_ref** | [**Vec<Vec<String>>**](array.md) | | | ||
**list_with_object_ref** | [**Vec<::std::collections::HashMap<String, serde_json::Value>>**](map.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) | ||
|
||
|
33 changes: 33 additions & 0 deletions
33
samples/client/petstore/rust/reqwest/petstore-async/src/models/array_item_ref_test.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,33 @@ | ||
/* | ||
* 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 | ||
*/ | ||
|
||
/// ArrayItemRefTest : Test handling of object reference in arrays | ||
|
||
|
||
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] | ||
pub struct ArrayItemRefTest { | ||
#[serde(rename = "list_with_array_ref")] | ||
pub list_with_array_ref: Vec<Vec<String>>, | ||
#[serde(rename = "list_with_object_ref")] | ||
pub list_with_object_ref: Vec<::std::collections::HashMap<String, serde_json::Value>>, | ||
} | ||
|
||
impl ArrayItemRefTest { | ||
/// Test handling of object reference in arrays | ||
pub fn new(list_with_array_ref: Vec<Vec<String>>, list_with_object_ref: Vec<::std::collections::HashMap<String, serde_json::Value>>) -> ArrayItemRefTest { | ||
ArrayItemRefTest { | ||
list_with_array_ref, | ||
list_with_object_ref, | ||
} | ||
} | ||
} | ||
|
||
|
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
12 changes: 12 additions & 0 deletions
12
...s/client/petstore/rust/reqwest/petstore-awsv4signature/docs/ArrayItemRefTest.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,12 @@ | ||
# ArrayItemRefTest | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**list_with_array_ref** | [**Vec<Vec<String>>**](array.md) | | | ||
**list_with_object_ref** | [**Vec<::std::collections::HashMap<String, serde_json::Value>>**](map.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) | ||
|
||
|
33 changes: 33 additions & 0 deletions
33
...es/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/array_item_ref_test.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,33 @@ | ||
/* | ||
* 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 | ||
*/ | ||
|
||
/// ArrayItemRefTest : Test handling of object reference in arrays | ||
|
||
|
||
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] | ||
pub struct ArrayItemRefTest { | ||
#[serde(rename = "list_with_array_ref")] | ||
pub list_with_array_ref: Vec<Vec<String>>, | ||
#[serde(rename = "list_with_object_ref")] | ||
pub list_with_object_ref: Vec<::std::collections::HashMap<String, serde_json::Value>>, | ||
} | ||
|
||
impl ArrayItemRefTest { | ||
/// Test handling of object reference in arrays | ||
pub fn new(list_with_array_ref: Vec<Vec<String>>, list_with_object_ref: Vec<::std::collections::HashMap<String, serde_json::Value>>) -> ArrayItemRefTest { | ||
ArrayItemRefTest { | ||
list_with_array_ref, | ||
list_with_object_ref, | ||
} | ||
} | ||
} | ||
|
||
|
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.