forked from loafle/openapi-generator-original
[Rust] Fixed Rust default isAnyType
causing compiler issues. (#20631)
* Fixed Rust default `isAnyType` causing compiler issues. * Added tests for Rust isAnyType's * Fixed thread_test.rs
This commit is contained in:
parent
21bf477da3
commit
9ed15a1c97
@ -633,6 +633,18 @@ public class RustClientCodegen extends AbstractRustCodegen implements CodegenCon
|
||||
List<CodegenOperation> operations = objectMap.getOperation();
|
||||
for (CodegenOperation operation : operations) {
|
||||
if (operation.pathParams != null && operation.pathParams.size() > 0) {
|
||||
|
||||
// For types with `isAnyType` we assume it's a `serde_json::Value` type.
|
||||
// However for path, query, and headers it's unlikely to be JSON so we default to `String`.
|
||||
// Note that we keep the default `serde_json::Value` for body parameters.
|
||||
for (var param : operation.allParams) {
|
||||
if (param.isAnyType && (param.isPathParam || param.isQueryParam || param.isHeaderParam)) {
|
||||
param.dataType = "String";
|
||||
param.isPrimitiveType = true;
|
||||
param.isString = true;
|
||||
}
|
||||
}
|
||||
|
||||
for (var pathParam : operation.pathParams) {
|
||||
if (!pathParam.baseName.contains("-")) {
|
||||
continue;
|
||||
|
@ -615,6 +615,11 @@ paths:
|
||||
description: To test escaping of parameters in rust code works
|
||||
schema:
|
||||
type: string
|
||||
# For testing `isAnyType` types
|
||||
- name: anyType
|
||||
in: query
|
||||
required: true
|
||||
schema: {}
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
@ -996,3 +1001,9 @@ components:
|
||||
properties:
|
||||
dummy:
|
||||
type: string
|
||||
AnyTypeTest:
|
||||
type: object
|
||||
properties:
|
||||
foo: {}
|
||||
required: ["foo"]
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
Cargo.toml
|
||||
README.md
|
||||
docs/ActionContainer.md
|
||||
docs/AnyTypeTest.md
|
||||
docs/ApiResponse.md
|
||||
docs/ArrayItemRefTest.md
|
||||
docs/Baz.md
|
||||
@ -37,6 +38,7 @@ src/apis/testing_api.rs
|
||||
src/apis/user_api.rs
|
||||
src/lib.rs
|
||||
src/models/action_container.rs
|
||||
src/models/any_type_test.rs
|
||||
src/models/api_response.rs
|
||||
src/models/array_item_ref_test.rs
|
||||
src/models/baz.rs
|
||||
|
@ -54,6 +54,7 @@ Class | Method | HTTP request | Description
|
||||
## Documentation For Models
|
||||
|
||||
- [ActionContainer](docs/ActionContainer.md)
|
||||
- [AnyTypeTest](docs/AnyTypeTest.md)
|
||||
- [ApiResponse](docs/ApiResponse.md)
|
||||
- [ArrayItemRefTest](docs/ArrayItemRefTest.md)
|
||||
- [Baz](docs/Baz.md)
|
||||
|
@ -0,0 +1,11 @@
|
||||
# AnyTypeTest
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**foo** | Option<[**serde_json::Value**](.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)
|
||||
|
||||
|
@ -10,7 +10,7 @@ Method | HTTP request | Description
|
||||
|
||||
## test_nullable_required_param
|
||||
|
||||
> test_nullable_required_param(user_name, dummy_required_nullable_param, uppercase, content)
|
||||
> test_nullable_required_param(user_name, dummy_required_nullable_param, any_type, uppercase, content)
|
||||
To test nullable required parameters
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@ Name | Type | Description | Required | Notes
|
||||
------------- | ------------- | ------------- | ------------- | -------------
|
||||
**user_name** | **String** | The name that needs to be fetched. Use user1 for testing. | [required] |
|
||||
**dummy_required_nullable_param** | Option<**String**> | To test nullable required parameters | [required] |
|
||||
**any_type** | **String** | | [required] |
|
||||
**uppercase** | Option<**String**> | To test parameter names in upper case | |
|
||||
**content** | Option<**String**> | To test escaping of parameters in rust code works | |
|
||||
|
||||
|
@ -37,19 +37,20 @@ impl<C: Connect> FakeApiClient<C>
|
||||
}
|
||||
|
||||
pub trait FakeApi: Send + Sync {
|
||||
fn test_nullable_required_param(&self, user_name: &str, dummy_required_nullable_param: Option<&str>, uppercase: Option<&str>, content: Option<&str>) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>;
|
||||
fn test_nullable_required_param(&self, user_name: &str, dummy_required_nullable_param: Option<&str>, any_type: &str, uppercase: Option<&str>, content: Option<&str>) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>;
|
||||
}
|
||||
|
||||
impl<C: Connect>FakeApi for FakeApiClient<C>
|
||||
where C: Clone + std::marker::Send + Sync {
|
||||
#[allow(unused_mut)]
|
||||
fn test_nullable_required_param(&self, user_name: &str, dummy_required_nullable_param: Option<&str>, uppercase: Option<&str>, content: Option<&str>) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>> {
|
||||
fn test_nullable_required_param(&self, user_name: &str, dummy_required_nullable_param: Option<&str>, any_type: &str, uppercase: Option<&str>, content: Option<&str>) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>> {
|
||||
let mut req = __internal_request::Request::new(hyper::Method::GET, "/fake/user/{user_name}".to_string())
|
||||
;
|
||||
if let Some(ref s) = content {
|
||||
let query_value = s.to_string();
|
||||
req = req.with_query_param("content".to_string(), query_value);
|
||||
}
|
||||
req = req.with_query_param("anyType".to_string(), any_type.to_string());
|
||||
req = req.with_path_param("user_name".to_string(), user_name.to_string());
|
||||
match dummy_required_nullable_param {
|
||||
Some(param_value) => { req = req.with_header_param("dummy_required_nullable_param".to_string(), param_value.to_string()); },
|
||||
|
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
use crate::models;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct AnyTypeTest {
|
||||
#[serde(rename = "foo", deserialize_with = "Option::deserialize")]
|
||||
pub foo: Option<serde_json::Value>,
|
||||
}
|
||||
|
||||
impl AnyTypeTest {
|
||||
pub fn new(foo: Option<serde_json::Value>) -> AnyTypeTest {
|
||||
AnyTypeTest {
|
||||
foo,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
pub mod action_container;
|
||||
pub use self::action_container::ActionContainer;
|
||||
pub mod any_type_test;
|
||||
pub use self::any_type_test::AnyTypeTest;
|
||||
pub mod api_response;
|
||||
pub use self::api_response::ApiResponse;
|
||||
pub mod array_item_ref_test;
|
||||
|
@ -11,7 +11,7 @@ mod tests {
|
||||
let handle = thread::spawn(move || {
|
||||
let _ = client
|
||||
.fake_api()
|
||||
.test_nullable_required_param("username", None, None, None);
|
||||
.test_nullable_required_param("username", None, "any_type", None, None);
|
||||
});
|
||||
|
||||
handle.join().expect("Thread panicked!");
|
||||
|
@ -3,6 +3,7 @@
|
||||
Cargo.toml
|
||||
README.md
|
||||
docs/ActionContainer.md
|
||||
docs/AnyTypeTest.md
|
||||
docs/ApiResponse.md
|
||||
docs/ArrayItemRefTest.md
|
||||
docs/Baz.md
|
||||
@ -35,6 +36,7 @@ src/apis/testing_api.rs
|
||||
src/apis/user_api.rs
|
||||
src/lib.rs
|
||||
src/models/action_container.rs
|
||||
src/models/any_type_test.rs
|
||||
src/models/api_response.rs
|
||||
src/models/array_item_ref_test.rs
|
||||
src/models/baz.rs
|
||||
|
@ -54,6 +54,7 @@ Class | Method | HTTP request | Description
|
||||
## Documentation For Models
|
||||
|
||||
- [ActionContainer](docs/ActionContainer.md)
|
||||
- [AnyTypeTest](docs/AnyTypeTest.md)
|
||||
- [ApiResponse](docs/ApiResponse.md)
|
||||
- [ArrayItemRefTest](docs/ArrayItemRefTest.md)
|
||||
- [Baz](docs/Baz.md)
|
||||
|
@ -0,0 +1,11 @@
|
||||
# AnyTypeTest
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**foo** | Option<[**serde_json::Value**](.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)
|
||||
|
||||
|
@ -10,7 +10,7 @@ Method | HTTP request | Description
|
||||
|
||||
## test_nullable_required_param
|
||||
|
||||
> test_nullable_required_param(user_name, dummy_required_nullable_param, uppercase, content)
|
||||
> test_nullable_required_param(user_name, dummy_required_nullable_param, any_type, uppercase, content)
|
||||
To test nullable required parameters
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@ Name | Type | Description | Required | Notes
|
||||
------------- | ------------- | ------------- | ------------- | -------------
|
||||
**user_name** | **String** | The name that needs to be fetched. Use user1 for testing. | [required] |
|
||||
**dummy_required_nullable_param** | Option<**String**> | To test nullable required parameters | [required] |
|
||||
**any_type** | **String** | | [required] |
|
||||
**uppercase** | Option<**String**> | To test parameter names in upper case | |
|
||||
**content** | Option<**String**> | To test escaping of parameters in rust code works | |
|
||||
|
||||
|
@ -36,19 +36,20 @@ impl<C: hyper::client::connect::Connect> FakeApiClient<C>
|
||||
}
|
||||
|
||||
pub trait FakeApi {
|
||||
fn test_nullable_required_param(&self, user_name: &str, dummy_required_nullable_param: Option<&str>, uppercase: Option<&str>, content: Option<&str>) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
|
||||
fn test_nullable_required_param(&self, user_name: &str, dummy_required_nullable_param: Option<&str>, any_type: &str, uppercase: Option<&str>, content: Option<&str>) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>;
|
||||
}
|
||||
|
||||
impl<C: hyper::client::connect::Connect>FakeApi for FakeApiClient<C>
|
||||
where C: Clone + std::marker::Send + Sync {
|
||||
#[allow(unused_mut)]
|
||||
fn test_nullable_required_param(&self, user_name: &str, dummy_required_nullable_param: Option<&str>, uppercase: Option<&str>, content: Option<&str>) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
|
||||
fn test_nullable_required_param(&self, user_name: &str, dummy_required_nullable_param: Option<&str>, any_type: &str, uppercase: Option<&str>, content: Option<&str>) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> {
|
||||
let mut req = __internal_request::Request::new(hyper::Method::GET, "/fake/user/{user_name}".to_string())
|
||||
;
|
||||
if let Some(ref s) = content {
|
||||
let query_value = s.to_string();
|
||||
req = req.with_query_param("content".to_string(), query_value);
|
||||
}
|
||||
req = req.with_query_param("anyType".to_string(), any_type.to_string());
|
||||
req = req.with_path_param("user_name".to_string(), user_name.to_string());
|
||||
match dummy_required_nullable_param {
|
||||
Some(param_value) => { req = req.with_header_param("dummy_required_nullable_param".to_string(), param_value.to_string()); },
|
||||
|
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
use crate::models;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct AnyTypeTest {
|
||||
#[serde(rename = "foo", deserialize_with = "Option::deserialize")]
|
||||
pub foo: Option<serde_json::Value>,
|
||||
}
|
||||
|
||||
impl AnyTypeTest {
|
||||
pub fn new(foo: Option<serde_json::Value>) -> AnyTypeTest {
|
||||
AnyTypeTest {
|
||||
foo,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
pub mod action_container;
|
||||
pub use self::action_container::ActionContainer;
|
||||
pub mod any_type_test;
|
||||
pub use self::any_type_test::AnyTypeTest;
|
||||
pub mod api_response;
|
||||
pub use self::api_response::ApiResponse;
|
||||
pub mod array_item_ref_test;
|
||||
|
@ -3,6 +3,7 @@
|
||||
Cargo.toml
|
||||
README.md
|
||||
docs/ActionContainer.md
|
||||
docs/AnyTypeTest.md
|
||||
docs/ApiResponse.md
|
||||
docs/ArrayItemRefTest.md
|
||||
docs/Baz.md
|
||||
@ -35,6 +36,7 @@ src/apis/testing_api.rs
|
||||
src/apis/user_api.rs
|
||||
src/lib.rs
|
||||
src/models/action_container.rs
|
||||
src/models/any_type_test.rs
|
||||
src/models/api_response.rs
|
||||
src/models/array_item_ref_test.rs
|
||||
src/models/baz.rs
|
||||
|
@ -54,6 +54,7 @@ Class | Method | HTTP request | Description
|
||||
## Documentation For Models
|
||||
|
||||
- [ActionContainer](docs/ActionContainer.md)
|
||||
- [AnyTypeTest](docs/AnyTypeTest.md)
|
||||
- [ApiResponse](docs/ApiResponse.md)
|
||||
- [ArrayItemRefTest](docs/ArrayItemRefTest.md)
|
||||
- [Baz](docs/Baz.md)
|
||||
|
@ -0,0 +1,11 @@
|
||||
# AnyTypeTest
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**foo** | Option<[**serde_json::Value**](.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)
|
||||
|
||||
|
@ -10,7 +10,7 @@ Method | HTTP request | Description
|
||||
|
||||
## test_nullable_required_param
|
||||
|
||||
> test_nullable_required_param(user_name, dummy_required_nullable_param, uppercase, content)
|
||||
> test_nullable_required_param(user_name, dummy_required_nullable_param, any_type, uppercase, content)
|
||||
To test nullable required parameters
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@ Name | Type | Description | Required | Notes
|
||||
------------- | ------------- | ------------- | ------------- | -------------
|
||||
**user_name** | **String** | The name that needs to be fetched. Use user1 for testing. | [required] |
|
||||
**dummy_required_nullable_param** | Option<**String**> | To test nullable required parameters | [required] |
|
||||
**any_type** | **String** | | [required] |
|
||||
**uppercase** | Option<**String**> | To test parameter names in upper case | |
|
||||
**content** | Option<**String**> | To test escaping of parameters in rust code works | |
|
||||
|
||||
|
@ -23,7 +23,7 @@ use super::{Error, configuration};
|
||||
pub trait FakeApi: Send + Sync {
|
||||
|
||||
/// GET /fake/user/{user_name}
|
||||
async fn test_nullable_required_param<'user_name, 'dummy_required_nullable_param, 'uppercase, 'content>(&self, user_name: &'user_name str, dummy_required_nullable_param: Option<&'dummy_required_nullable_param str>, uppercase: Option<&'uppercase str>, content: Option<&'content str>) -> Result<(), Error<TestNullableRequiredParamError>>;
|
||||
async fn test_nullable_required_param<'user_name, 'dummy_required_nullable_param, 'any_type, 'uppercase, 'content>(&self, user_name: &'user_name str, dummy_required_nullable_param: Option<&'dummy_required_nullable_param str>, any_type: &'any_type str, uppercase: Option<&'uppercase str>, content: Option<&'content str>) -> Result<(), Error<TestNullableRequiredParamError>>;
|
||||
}
|
||||
|
||||
pub struct FakeApiClient {
|
||||
@ -41,7 +41,7 @@ impl FakeApiClient {
|
||||
#[async_trait]
|
||||
impl FakeApi for FakeApiClient {
|
||||
///
|
||||
async fn test_nullable_required_param<'user_name, 'dummy_required_nullable_param, 'uppercase, 'content>(&self, user_name: &'user_name str, dummy_required_nullable_param: Option<&'dummy_required_nullable_param str>, uppercase: Option<&'uppercase str>, content: Option<&'content str>) -> Result<(), Error<TestNullableRequiredParamError>> {
|
||||
async fn test_nullable_required_param<'user_name, 'dummy_required_nullable_param, 'any_type, 'uppercase, 'content>(&self, user_name: &'user_name str, dummy_required_nullable_param: Option<&'dummy_required_nullable_param str>, any_type: &'any_type str, uppercase: Option<&'uppercase str>, content: Option<&'content str>) -> Result<(), Error<TestNullableRequiredParamError>> {
|
||||
let local_var_configuration = &self.configuration;
|
||||
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
@ -52,6 +52,7 @@ impl FakeApi for FakeApiClient {
|
||||
if let Some(ref local_var_str) = content {
|
||||
local_var_req_builder = local_var_req_builder.query(&[("content", &local_var_str.to_string())]);
|
||||
}
|
||||
local_var_req_builder = local_var_req_builder.query(&[("anyType", &any_type.to_string())]);
|
||||
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());
|
||||
}
|
||||
|
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
use crate::models;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct AnyTypeTest {
|
||||
#[serde(rename = "foo", deserialize_with = "Option::deserialize")]
|
||||
pub foo: Option<serde_json::Value>,
|
||||
}
|
||||
|
||||
impl AnyTypeTest {
|
||||
pub fn new(foo: Option<serde_json::Value>) -> AnyTypeTest {
|
||||
AnyTypeTest {
|
||||
foo,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
pub mod action_container;
|
||||
pub use self::action_container::ActionContainer;
|
||||
pub mod any_type_test;
|
||||
pub use self::any_type_test::AnyTypeTest;
|
||||
pub mod api_response;
|
||||
pub use self::api_response::ApiResponse;
|
||||
pub mod array_item_ref_test;
|
||||
|
@ -3,6 +3,7 @@
|
||||
Cargo.toml
|
||||
README.md
|
||||
docs/ActionContainer.md
|
||||
docs/AnyTypeTest.md
|
||||
docs/ApiResponse.md
|
||||
docs/ArrayItemRefTest.md
|
||||
docs/Baz.md
|
||||
@ -35,6 +36,7 @@ src/apis/testing_api.rs
|
||||
src/apis/user_api.rs
|
||||
src/lib.rs
|
||||
src/models/action_container.rs
|
||||
src/models/any_type_test.rs
|
||||
src/models/api_response.rs
|
||||
src/models/array_item_ref_test.rs
|
||||
src/models/baz.rs
|
||||
|
@ -54,6 +54,7 @@ Class | Method | HTTP request | Description
|
||||
## Documentation For Models
|
||||
|
||||
- [ActionContainer](docs/ActionContainer.md)
|
||||
- [AnyTypeTest](docs/AnyTypeTest.md)
|
||||
- [ApiResponse](docs/ApiResponse.md)
|
||||
- [ArrayItemRefTest](docs/ArrayItemRefTest.md)
|
||||
- [Baz](docs/Baz.md)
|
||||
|
@ -0,0 +1,11 @@
|
||||
# AnyTypeTest
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**foo** | Option<[**serde_json::Value**](.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)
|
||||
|
||||
|
@ -10,7 +10,7 @@ Method | HTTP request | Description
|
||||
|
||||
## test_nullable_required_param
|
||||
|
||||
> test_nullable_required_param(user_name, dummy_required_nullable_param, uppercase, content)
|
||||
> test_nullable_required_param(user_name, dummy_required_nullable_param, any_type, uppercase, content)
|
||||
To test nullable required parameters
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@ Name | Type | Description | Required | Notes
|
||||
------------- | ------------- | ------------- | ------------- | -------------
|
||||
**user_name** | **String** | The name that needs to be fetched. Use user1 for testing. | [required] |
|
||||
**dummy_required_nullable_param** | Option<**String**> | To test nullable required parameters | [required] |
|
||||
**any_type** | **String** | | [required] |
|
||||
**uppercase** | Option<**String**> | To test parameter names in upper case | |
|
||||
**content** | Option<**String**> | To test escaping of parameters in rust code works | |
|
||||
|
||||
|
@ -21,6 +21,7 @@ pub struct TestNullableRequiredParamParams {
|
||||
pub user_name: String,
|
||||
/// To test nullable required parameters
|
||||
pub dummy_required_nullable_param: Option<String>,
|
||||
pub any_type: String,
|
||||
/// To test parameter names in upper case
|
||||
pub uppercase: Option<String>,
|
||||
/// To test escaping of parameters in rust code works
|
||||
@ -55,6 +56,7 @@ pub async fn test_nullable_required_param(configuration: &configuration::Configu
|
||||
if let Some(ref param_value) = params.content {
|
||||
req_builder = req_builder.query(&[("content", ¶m_value.to_string())]);
|
||||
}
|
||||
req_builder = req_builder.query(&[("anyType", ¶ms.any_type.to_string())]);
|
||||
if let Some(ref user_agent) = configuration.user_agent {
|
||||
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
|
||||
}
|
||||
|
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
use crate::models;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct AnyTypeTest {
|
||||
#[serde(rename = "foo", deserialize_with = "Option::deserialize")]
|
||||
pub foo: Option<serde_json::Value>,
|
||||
}
|
||||
|
||||
impl AnyTypeTest {
|
||||
pub fn new(foo: Option<serde_json::Value>) -> AnyTypeTest {
|
||||
AnyTypeTest {
|
||||
foo,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
pub mod action_container;
|
||||
pub use self::action_container::ActionContainer;
|
||||
pub mod any_type_test;
|
||||
pub use self::any_type_test::AnyTypeTest;
|
||||
pub mod api_response;
|
||||
pub use self::api_response::ApiResponse;
|
||||
pub mod array_item_ref_test;
|
||||
|
@ -3,6 +3,7 @@
|
||||
Cargo.toml
|
||||
README.md
|
||||
docs/ActionContainer.md
|
||||
docs/AnyTypeTest.md
|
||||
docs/ApiResponse.md
|
||||
docs/ArrayItemRefTest.md
|
||||
docs/Baz.md
|
||||
@ -35,6 +36,7 @@ src/apis/testing_api.rs
|
||||
src/apis/user_api.rs
|
||||
src/lib.rs
|
||||
src/models/action_container.rs
|
||||
src/models/any_type_test.rs
|
||||
src/models/api_response.rs
|
||||
src/models/array_item_ref_test.rs
|
||||
src/models/baz.rs
|
||||
|
@ -54,6 +54,7 @@ Class | Method | HTTP request | Description
|
||||
## Documentation For Models
|
||||
|
||||
- [ActionContainer](docs/ActionContainer.md)
|
||||
- [AnyTypeTest](docs/AnyTypeTest.md)
|
||||
- [ApiResponse](docs/ApiResponse.md)
|
||||
- [ArrayItemRefTest](docs/ArrayItemRefTest.md)
|
||||
- [Baz](docs/Baz.md)
|
||||
|
@ -0,0 +1,11 @@
|
||||
# AnyTypeTest
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**foo** | Option<[**serde_json::Value**](.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)
|
||||
|
||||
|
@ -10,7 +10,7 @@ Method | HTTP request | Description
|
||||
|
||||
## test_nullable_required_param
|
||||
|
||||
> test_nullable_required_param(user_name, dummy_required_nullable_param, uppercase, content)
|
||||
> test_nullable_required_param(user_name, dummy_required_nullable_param, any_type, uppercase, content)
|
||||
To test nullable required parameters
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@ Name | Type | Description | Required | Notes
|
||||
------------- | ------------- | ------------- | ------------- | -------------
|
||||
**user_name** | **String** | The name that needs to be fetched. Use user1 for testing. | [required] |
|
||||
**dummy_required_nullable_param** | Option<**String**> | To test nullable required parameters | [required] |
|
||||
**any_type** | **String** | | [required] |
|
||||
**uppercase** | Option<**String**> | To test parameter names in upper case | |
|
||||
**content** | Option<**String**> | To test escaping of parameters in rust code works | |
|
||||
|
||||
|
@ -21,6 +21,7 @@ pub struct TestNullableRequiredParamParams {
|
||||
pub user_name: String,
|
||||
/// To test nullable required parameters
|
||||
pub dummy_required_nullable_param: Option<String>,
|
||||
pub any_type: String,
|
||||
/// To test parameter names in upper case
|
||||
pub uppercase: Option<String>,
|
||||
/// To test escaping of parameters in rust code works
|
||||
@ -55,6 +56,7 @@ pub async fn test_nullable_required_param(configuration: &configuration::Configu
|
||||
if let Some(ref param_value) = params.content {
|
||||
req_builder = req_builder.query(&[("content", ¶m_value.to_string())]);
|
||||
}
|
||||
req_builder = req_builder.query(&[("anyType", ¶ms.any_type.to_string())]);
|
||||
if let Some(ref user_agent) = configuration.user_agent {
|
||||
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
|
||||
}
|
||||
|
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
use crate::models;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct AnyTypeTest {
|
||||
#[serde(rename = "foo", deserialize_with = "Option::deserialize")]
|
||||
pub foo: Option<serde_json::Value>,
|
||||
}
|
||||
|
||||
impl AnyTypeTest {
|
||||
pub fn new(foo: Option<serde_json::Value>) -> AnyTypeTest {
|
||||
AnyTypeTest {
|
||||
foo,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
pub mod action_container;
|
||||
pub use self::action_container::ActionContainer;
|
||||
pub mod any_type_test;
|
||||
pub use self::any_type_test::AnyTypeTest;
|
||||
pub mod api_response;
|
||||
pub use self::api_response::ApiResponse;
|
||||
pub mod array_item_ref_test;
|
||||
|
@ -3,6 +3,7 @@
|
||||
Cargo.toml
|
||||
README.md
|
||||
docs/ActionContainer.md
|
||||
docs/AnyTypeTest.md
|
||||
docs/ApiResponse.md
|
||||
docs/ArrayItemRefTest.md
|
||||
docs/Baz.md
|
||||
@ -35,6 +36,7 @@ src/apis/testing_api.rs
|
||||
src/apis/user_api.rs
|
||||
src/lib.rs
|
||||
src/models/action_container.rs
|
||||
src/models/any_type_test.rs
|
||||
src/models/api_response.rs
|
||||
src/models/array_item_ref_test.rs
|
||||
src/models/baz.rs
|
||||
|
@ -54,6 +54,7 @@ Class | Method | HTTP request | Description
|
||||
## Documentation For Models
|
||||
|
||||
- [ActionContainer](docs/ActionContainer.md)
|
||||
- [AnyTypeTest](docs/AnyTypeTest.md)
|
||||
- [ApiResponse](docs/ApiResponse.md)
|
||||
- [ArrayItemRefTest](docs/ArrayItemRefTest.md)
|
||||
- [Baz](docs/Baz.md)
|
||||
|
@ -0,0 +1,11 @@
|
||||
# AnyTypeTest
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**foo** | Option<[**serde_json::Value**](.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)
|
||||
|
||||
|
@ -10,7 +10,7 @@ Method | HTTP request | Description
|
||||
|
||||
## test_nullable_required_param
|
||||
|
||||
> test_nullable_required_param(user_name, dummy_required_nullable_param, uppercase, content)
|
||||
> test_nullable_required_param(user_name, dummy_required_nullable_param, any_type, uppercase, content)
|
||||
To test nullable required parameters
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@ Name | Type | Description | Required | Notes
|
||||
------------- | ------------- | ------------- | ------------- | -------------
|
||||
**user_name** | **String** | The name that needs to be fetched. Use user1 for testing. | [required] |
|
||||
**dummy_required_nullable_param** | Option<**String**> | To test nullable required parameters | [required] |
|
||||
**any_type** | **String** | | [required] |
|
||||
**uppercase** | Option<**String**> | To test parameter names in upper case | |
|
||||
**content** | Option<**String**> | To test escaping of parameters in rust code works | |
|
||||
|
||||
|
@ -21,6 +21,7 @@ pub struct TestNullableRequiredParamParams {
|
||||
pub user_name: String,
|
||||
/// To test nullable required parameters
|
||||
pub dummy_required_nullable_param: Option<String>,
|
||||
pub any_type: String,
|
||||
/// To test parameter names in upper case
|
||||
pub uppercase: Option<String>,
|
||||
/// To test escaping of parameters in rust code works
|
||||
@ -55,6 +56,7 @@ pub async fn test_nullable_required_param(configuration: &configuration::Configu
|
||||
if let Some(ref param_value) = params.content {
|
||||
req_builder = req_builder.query(&[("content", ¶m_value.to_string())]);
|
||||
}
|
||||
req_builder = req_builder.query(&[("anyType", ¶ms.any_type.to_string())]);
|
||||
if let Some(ref user_agent) = configuration.user_agent {
|
||||
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
|
||||
}
|
||||
|
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
use crate::models;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct AnyTypeTest {
|
||||
#[serde(rename = "foo", deserialize_with = "Option::deserialize")]
|
||||
pub foo: Option<serde_json::Value>,
|
||||
}
|
||||
|
||||
impl AnyTypeTest {
|
||||
pub fn new(foo: Option<serde_json::Value>) -> AnyTypeTest {
|
||||
AnyTypeTest {
|
||||
foo,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
pub mod action_container;
|
||||
pub use self::action_container::ActionContainer;
|
||||
pub mod any_type_test;
|
||||
pub use self::any_type_test::AnyTypeTest;
|
||||
pub mod api_response;
|
||||
pub use self::api_response::ApiResponse;
|
||||
pub mod array_item_ref_test;
|
||||
|
@ -3,6 +3,7 @@
|
||||
Cargo.toml
|
||||
README.md
|
||||
docs/ActionContainer.md
|
||||
docs/AnyTypeTest.md
|
||||
docs/ApiResponse.md
|
||||
docs/ArrayItemRefTest.md
|
||||
docs/Baz.md
|
||||
@ -35,6 +36,7 @@ src/apis/testing_api.rs
|
||||
src/apis/user_api.rs
|
||||
src/lib.rs
|
||||
src/models/action_container.rs
|
||||
src/models/any_type_test.rs
|
||||
src/models/api_response.rs
|
||||
src/models/array_item_ref_test.rs
|
||||
src/models/baz.rs
|
||||
|
@ -54,6 +54,7 @@ Class | Method | HTTP request | Description
|
||||
## Documentation For Models
|
||||
|
||||
- [ActionContainer](docs/ActionContainer.md)
|
||||
- [AnyTypeTest](docs/AnyTypeTest.md)
|
||||
- [ApiResponse](docs/ApiResponse.md)
|
||||
- [ArrayItemRefTest](docs/ArrayItemRefTest.md)
|
||||
- [Baz](docs/Baz.md)
|
||||
|
@ -0,0 +1,11 @@
|
||||
# AnyTypeTest
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**foo** | Option<[**serde_json::Value**](.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)
|
||||
|
||||
|
@ -10,7 +10,7 @@ Method | HTTP request | Description
|
||||
|
||||
## test_nullable_required_param
|
||||
|
||||
> test_nullable_required_param(user_name, dummy_required_nullable_param, uppercase, content)
|
||||
> test_nullable_required_param(user_name, dummy_required_nullable_param, any_type, uppercase, content)
|
||||
To test nullable required parameters
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@ Name | Type | Description | Required | Notes
|
||||
------------- | ------------- | ------------- | ------------- | -------------
|
||||
**user_name** | **String** | The name that needs to be fetched. Use user1 for testing. | [required] |
|
||||
**dummy_required_nullable_param** | Option<**String**> | To test nullable required parameters | [required] |
|
||||
**any_type** | **String** | | [required] |
|
||||
**uppercase** | Option<**String**> | To test parameter names in upper case | |
|
||||
**content** | Option<**String**> | To test escaping of parameters in rust code works | |
|
||||
|
||||
|
@ -21,6 +21,7 @@ pub struct TestNullableRequiredParamParams {
|
||||
pub user_name: String,
|
||||
/// To test nullable required parameters
|
||||
pub dummy_required_nullable_param: Option<String>,
|
||||
pub any_type: String,
|
||||
/// To test parameter names in upper case
|
||||
pub uppercase: Option<String>,
|
||||
/// To test escaping of parameters in rust code works
|
||||
@ -55,6 +56,7 @@ pub async fn test_nullable_required_param(configuration: &configuration::Configu
|
||||
if let Some(ref param_value) = params.content {
|
||||
req_builder = req_builder.query(&[("content", ¶m_value.to_string())]);
|
||||
}
|
||||
req_builder = req_builder.query(&[("anyType", ¶ms.any_type.to_string())]);
|
||||
if let Some(ref user_agent) = configuration.user_agent {
|
||||
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
|
||||
}
|
||||
|
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
use crate::models;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct AnyTypeTest {
|
||||
#[serde(rename = "foo", deserialize_with = "Option::deserialize")]
|
||||
pub foo: Option<serde_json::Value>,
|
||||
}
|
||||
|
||||
impl AnyTypeTest {
|
||||
pub fn new(foo: Option<serde_json::Value>) -> AnyTypeTest {
|
||||
AnyTypeTest {
|
||||
foo,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
pub mod action_container;
|
||||
pub use self::action_container::ActionContainer;
|
||||
pub mod any_type_test;
|
||||
pub use self::any_type_test::AnyTypeTest;
|
||||
pub mod api_response;
|
||||
pub use self::api_response::ApiResponse;
|
||||
pub mod array_item_ref_test;
|
||||
|
@ -3,6 +3,7 @@
|
||||
Cargo.toml
|
||||
README.md
|
||||
docs/ActionContainer.md
|
||||
docs/AnyTypeTest.md
|
||||
docs/ApiResponse.md
|
||||
docs/ArrayItemRefTest.md
|
||||
docs/Baz.md
|
||||
@ -35,6 +36,7 @@ src/apis/testing_api.rs
|
||||
src/apis/user_api.rs
|
||||
src/lib.rs
|
||||
src/models/action_container.rs
|
||||
src/models/any_type_test.rs
|
||||
src/models/api_response.rs
|
||||
src/models/array_item_ref_test.rs
|
||||
src/models/baz.rs
|
||||
|
@ -54,6 +54,7 @@ Class | Method | HTTP request | Description
|
||||
## Documentation For Models
|
||||
|
||||
- [ActionContainer](docs/ActionContainer.md)
|
||||
- [AnyTypeTest](docs/AnyTypeTest.md)
|
||||
- [ApiResponse](docs/ApiResponse.md)
|
||||
- [ArrayItemRefTest](docs/ArrayItemRefTest.md)
|
||||
- [Baz](docs/Baz.md)
|
||||
|
@ -0,0 +1,11 @@
|
||||
# AnyTypeTest
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**foo** | Option<[**serde_json::Value**](.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)
|
||||
|
||||
|
@ -10,7 +10,7 @@ Method | HTTP request | Description
|
||||
|
||||
## test_nullable_required_param
|
||||
|
||||
> test_nullable_required_param(user_name, dummy_required_nullable_param, uppercase, content)
|
||||
> test_nullable_required_param(user_name, dummy_required_nullable_param, any_type, uppercase, content)
|
||||
To test nullable required parameters
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@ Name | Type | Description | Required | Notes
|
||||
------------- | ------------- | ------------- | ------------- | -------------
|
||||
**user_name** | **String** | The name that needs to be fetched. Use user1 for testing. | [required] |
|
||||
**dummy_required_nullable_param** | Option<**String**> | To test nullable required parameters | [required] |
|
||||
**any_type** | **String** | | [required] |
|
||||
**uppercase** | Option<**String**> | To test parameter names in upper case | |
|
||||
**content** | Option<**String**> | To test escaping of parameters in rust code works | |
|
||||
|
||||
|
@ -26,10 +26,11 @@ pub enum TestNullableRequiredParamError {
|
||||
|
||||
|
||||
///
|
||||
pub fn test_nullable_required_param(configuration: &configuration::Configuration, user_name: &str, dummy_required_nullable_param: Option<&str>, uppercase: Option<&str>, content: Option<&str>) -> Result<(), Error<TestNullableRequiredParamError>> {
|
||||
pub fn test_nullable_required_param(configuration: &configuration::Configuration, user_name: &str, dummy_required_nullable_param: Option<&str>, any_type: &str, uppercase: Option<&str>, content: Option<&str>) -> Result<(), Error<TestNullableRequiredParamError>> {
|
||||
// add a prefix to parameters to efficiently prevent name collisions
|
||||
let p_user_name = user_name;
|
||||
let p_dummy_required_nullable_param = dummy_required_nullable_param;
|
||||
let p_any_type = any_type;
|
||||
let p_uppercase = uppercase;
|
||||
let p_content = content;
|
||||
|
||||
@ -39,6 +40,7 @@ pub fn test_nullable_required_param(configuration: &configuration::Configuration
|
||||
if let Some(ref param_value) = p_content {
|
||||
req_builder = req_builder.query(&[("content", ¶m_value.to_string())]);
|
||||
}
|
||||
req_builder = req_builder.query(&[("anyType", &p_any_type.to_string())]);
|
||||
if let Some(ref user_agent) = configuration.user_agent {
|
||||
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
|
||||
}
|
||||
|
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
use crate::models;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct AnyTypeTest {
|
||||
#[serde(rename = "foo", deserialize_with = "Option::deserialize")]
|
||||
pub foo: Option<serde_json::Value>,
|
||||
}
|
||||
|
||||
impl AnyTypeTest {
|
||||
pub fn new(foo: Option<serde_json::Value>) -> AnyTypeTest {
|
||||
AnyTypeTest {
|
||||
foo,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
pub mod action_container;
|
||||
pub use self::action_container::ActionContainer;
|
||||
pub mod any_type_test;
|
||||
pub use self::any_type_test::AnyTypeTest;
|
||||
pub mod api_response;
|
||||
pub use self::api_response::ApiResponse;
|
||||
pub mod array_item_ref_test;
|
||||
|
@ -4,6 +4,7 @@ Cargo.toml
|
||||
README.md
|
||||
docs/FakeApi.md
|
||||
docs/FooActionContainer.md
|
||||
docs/FooAnyTypeTest.md
|
||||
docs/FooApiResponse.md
|
||||
docs/FooArrayItemRefTest.md
|
||||
docs/FooBaz.md
|
||||
@ -35,6 +36,7 @@ src/apis/testing_api.rs
|
||||
src/apis/user_api.rs
|
||||
src/lib.rs
|
||||
src/models/foo_action_container.rs
|
||||
src/models/foo_any_type_test.rs
|
||||
src/models/foo_api_response.rs
|
||||
src/models/foo_array_item_ref_test.rs
|
||||
src/models/foo_baz.rs
|
||||
|
@ -54,6 +54,7 @@ Class | Method | HTTP request | Description
|
||||
## Documentation For Models
|
||||
|
||||
- [FooActionContainer](docs/FooActionContainer.md)
|
||||
- [FooAnyTypeTest](docs/FooAnyTypeTest.md)
|
||||
- [FooApiResponse](docs/FooApiResponse.md)
|
||||
- [FooArrayItemRefTest](docs/FooArrayItemRefTest.md)
|
||||
- [FooBaz](docs/FooBaz.md)
|
||||
|
@ -10,7 +10,7 @@ Method | HTTP request | Description
|
||||
|
||||
## test_nullable_required_param
|
||||
|
||||
> test_nullable_required_param(user_name, dummy_required_nullable_param, uppercase, content)
|
||||
> test_nullable_required_param(user_name, dummy_required_nullable_param, any_type, uppercase, content)
|
||||
To test nullable required parameters
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@ Name | Type | Description | Required | Notes
|
||||
------------- | ------------- | ------------- | ------------- | -------------
|
||||
**user_name** | **String** | The name that needs to be fetched. Use user1 for testing. | [required] |
|
||||
**dummy_required_nullable_param** | Option<**String**> | To test nullable required parameters | [required] |
|
||||
**any_type** | **String** | | [required] |
|
||||
**uppercase** | Option<**String**> | To test parameter names in upper case | |
|
||||
**content** | Option<**String**> | To test escaping of parameters in rust code works | |
|
||||
|
||||
|
@ -0,0 +1,11 @@
|
||||
# FooAnyTypeTest
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**foo** | Option<[**serde_json::Value**](.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)
|
||||
|
||||
|
@ -26,10 +26,11 @@ pub enum TestNullableRequiredParamError {
|
||||
|
||||
|
||||
///
|
||||
pub fn test_nullable_required_param(configuration: &configuration::Configuration, user_name: &str, dummy_required_nullable_param: Option<&str>, uppercase: Option<&str>, content: Option<&str>) -> Result<(), Error<TestNullableRequiredParamError>> {
|
||||
pub fn test_nullable_required_param(configuration: &configuration::Configuration, user_name: &str, dummy_required_nullable_param: Option<&str>, any_type: &str, uppercase: Option<&str>, content: Option<&str>) -> Result<(), Error<TestNullableRequiredParamError>> {
|
||||
// add a prefix to parameters to efficiently prevent name collisions
|
||||
let p_user_name = user_name;
|
||||
let p_dummy_required_nullable_param = dummy_required_nullable_param;
|
||||
let p_any_type = any_type;
|
||||
let p_uppercase = uppercase;
|
||||
let p_content = content;
|
||||
|
||||
@ -39,6 +40,7 @@ pub fn test_nullable_required_param(configuration: &configuration::Configuration
|
||||
if let Some(ref param_value) = p_content {
|
||||
req_builder = req_builder.query(&[("content", ¶m_value.to_string())]);
|
||||
}
|
||||
req_builder = req_builder.query(&[("anyType", &p_any_type.to_string())]);
|
||||
if let Some(ref user_agent) = configuration.user_agent {
|
||||
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
|
||||
}
|
||||
|
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
use crate::models;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct FooAnyTypeTest {
|
||||
#[serde(rename = "foo", deserialize_with = "Option::deserialize")]
|
||||
pub foo: Option<serde_json::Value>,
|
||||
}
|
||||
|
||||
impl FooAnyTypeTest {
|
||||
pub fn new(foo: Option<serde_json::Value>) -> FooAnyTypeTest {
|
||||
FooAnyTypeTest {
|
||||
foo,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
pub mod foo_action_container;
|
||||
pub use self::foo_action_container::FooActionContainer;
|
||||
pub mod foo_any_type_test;
|
||||
pub use self::foo_any_type_test::FooAnyTypeTest;
|
||||
pub mod foo_api_response;
|
||||
pub use self::foo_api_response::FooApiResponse;
|
||||
pub mod foo_array_item_ref_test;
|
||||
|
@ -3,6 +3,7 @@
|
||||
Cargo.toml
|
||||
README.md
|
||||
docs/ActionContainer.md
|
||||
docs/AnyTypeTest.md
|
||||
docs/ApiResponse.md
|
||||
docs/ArrayItemRefTest.md
|
||||
docs/Baz.md
|
||||
@ -35,6 +36,7 @@ src/apis/testing_api.rs
|
||||
src/apis/user_api.rs
|
||||
src/lib.rs
|
||||
src/models/action_container.rs
|
||||
src/models/any_type_test.rs
|
||||
src/models/api_response.rs
|
||||
src/models/array_item_ref_test.rs
|
||||
src/models/baz.rs
|
||||
|
@ -54,6 +54,7 @@ Class | Method | HTTP request | Description
|
||||
## Documentation For Models
|
||||
|
||||
- [ActionContainer](docs/ActionContainer.md)
|
||||
- [AnyTypeTest](docs/AnyTypeTest.md)
|
||||
- [ApiResponse](docs/ApiResponse.md)
|
||||
- [ArrayItemRefTest](docs/ArrayItemRefTest.md)
|
||||
- [Baz](docs/Baz.md)
|
||||
|
@ -0,0 +1,11 @@
|
||||
# AnyTypeTest
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**foo** | Option<[**serde_json::Value**](.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)
|
||||
|
||||
|
@ -10,7 +10,7 @@ Method | HTTP request | Description
|
||||
|
||||
## test_nullable_required_param
|
||||
|
||||
> test_nullable_required_param(user_name, dummy_required_nullable_param, uppercase, content)
|
||||
> test_nullable_required_param(user_name, dummy_required_nullable_param, any_type, uppercase, content)
|
||||
To test nullable required parameters
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@ Name | Type | Description | Required | Notes
|
||||
------------- | ------------- | ------------- | ------------- | -------------
|
||||
**user_name** | **String** | The name that needs to be fetched. Use user1 for testing. | [required] |
|
||||
**dummy_required_nullable_param** | Option<**String**> | To test nullable required parameters | [required] |
|
||||
**any_type** | **String** | | [required] |
|
||||
**uppercase** | Option<**String**> | To test parameter names in upper case | |
|
||||
**content** | Option<**String**> | To test escaping of parameters in rust code works | |
|
||||
|
||||
|
@ -26,10 +26,11 @@ pub enum TestNullableRequiredParamError {
|
||||
|
||||
|
||||
///
|
||||
pub fn test_nullable_required_param(configuration: &configuration::Configuration, user_name: &str, dummy_required_nullable_param: Option<&str>, uppercase: Option<&str>, content: Option<&str>) -> Result<(), Error<TestNullableRequiredParamError>> {
|
||||
pub fn test_nullable_required_param(configuration: &configuration::Configuration, user_name: &str, dummy_required_nullable_param: Option<&str>, any_type: &str, uppercase: Option<&str>, content: Option<&str>) -> Result<(), Error<TestNullableRequiredParamError>> {
|
||||
// add a prefix to parameters to efficiently prevent name collisions
|
||||
let p_user_name = user_name;
|
||||
let p_dummy_required_nullable_param = dummy_required_nullable_param;
|
||||
let p_any_type = any_type;
|
||||
let p_uppercase = uppercase;
|
||||
let p_content = content;
|
||||
|
||||
@ -39,6 +40,7 @@ pub fn test_nullable_required_param(configuration: &configuration::Configuration
|
||||
if let Some(ref param_value) = p_content {
|
||||
req_builder = req_builder.query(&[("content", ¶m_value.to_string())]);
|
||||
}
|
||||
req_builder = req_builder.query(&[("anyType", &p_any_type.to_string())]);
|
||||
if let Some(ref user_agent) = configuration.user_agent {
|
||||
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
|
||||
}
|
||||
|
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
use crate::models;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct AnyTypeTest {
|
||||
#[serde(rename = "foo", deserialize_with = "Option::deserialize")]
|
||||
pub foo: Option<serde_json::Value>,
|
||||
}
|
||||
|
||||
impl AnyTypeTest {
|
||||
pub fn new(foo: Option<serde_json::Value>) -> AnyTypeTest {
|
||||
AnyTypeTest {
|
||||
foo,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
pub mod action_container;
|
||||
pub use self::action_container::ActionContainer;
|
||||
pub mod any_type_test;
|
||||
pub use self::any_type_test::AnyTypeTest;
|
||||
pub mod api_response;
|
||||
pub use self::api_response::ApiResponse;
|
||||
pub mod array_item_ref_test;
|
||||
|
Loading…
x
Reference in New Issue
Block a user