forked from loafle/openapi-generator-original
Fix logic of getNullableType of csharp server and client. (#3537)
* Fix default nullable * Fix tests * Update samples * Fix template default value * Update samples * Also fix for interface * update samples
This commit is contained in:
committed by
William Cheng
parent
2bbebf9752
commit
5ab1c9c75b
@@ -31,7 +31,7 @@ this route creates an XmlItem
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -41,9 +41,10 @@ namespace Example
|
||||
{
|
||||
public class CreateXmlItemExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var xmlItem = new XmlItem(); // XmlItem | XmlItem Body
|
||||
|
||||
try
|
||||
@@ -51,9 +52,11 @@ namespace Example
|
||||
// creates an XmlItem
|
||||
apiInstance.CreateXmlItem(xmlItem);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.CreateXmlItem: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -80,6 +83,11 @@ No authorization required
|
||||
- **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -88,7 +96,7 @@ No authorization required
|
||||
|
||||
## FakeOuterBooleanSerialize
|
||||
|
||||
> bool? FakeOuterBooleanSerialize (bool? body = null)
|
||||
> bool FakeOuterBooleanSerialize (bool body = null)
|
||||
|
||||
|
||||
|
||||
@@ -97,7 +105,7 @@ Test serialization of outer boolean types
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -107,19 +115,22 @@ namespace Example
|
||||
{
|
||||
public class FakeOuterBooleanSerializeExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
var body = true; // bool? | Input boolean as post body (optional)
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var body = true; // bool | Input boolean as post body (optional)
|
||||
|
||||
try
|
||||
{
|
||||
bool? result = apiInstance.FakeOuterBooleanSerialize(body);
|
||||
bool result = apiInstance.FakeOuterBooleanSerialize(body);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -131,11 +142,11 @@ namespace Example
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | **bool?**| Input boolean as post body | [optional]
|
||||
**body** | **bool**| Input boolean as post body | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
**bool?**
|
||||
**bool**
|
||||
|
||||
### Authorization
|
||||
|
||||
@@ -146,6 +157,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Output boolean | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -163,7 +179,7 @@ Test serialization of object with outer number type
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -173,9 +189,10 @@ namespace Example
|
||||
{
|
||||
public class FakeOuterCompositeSerializeExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var body = new OuterComposite(); // OuterComposite | Input composite as post body (optional)
|
||||
|
||||
try
|
||||
@@ -183,9 +200,11 @@ namespace Example
|
||||
OuterComposite result = apiInstance.FakeOuterCompositeSerialize(body);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -212,6 +231,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Output composite | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -220,7 +244,7 @@ No authorization required
|
||||
|
||||
## FakeOuterNumberSerialize
|
||||
|
||||
> decimal? FakeOuterNumberSerialize (decimal? body = null)
|
||||
> decimal FakeOuterNumberSerialize (decimal body = null)
|
||||
|
||||
|
||||
|
||||
@@ -229,7 +253,7 @@ Test serialization of outer number types
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -239,19 +263,22 @@ namespace Example
|
||||
{
|
||||
public class FakeOuterNumberSerializeExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
var body = 8.14; // decimal? | Input number as post body (optional)
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var body = 8.14; // decimal | Input number as post body (optional)
|
||||
|
||||
try
|
||||
{
|
||||
decimal? result = apiInstance.FakeOuterNumberSerialize(body);
|
||||
decimal result = apiInstance.FakeOuterNumberSerialize(body);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -263,11 +290,11 @@ namespace Example
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | **decimal?**| Input number as post body | [optional]
|
||||
**body** | **decimal**| Input number as post body | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
**decimal?**
|
||||
**decimal**
|
||||
|
||||
### Authorization
|
||||
|
||||
@@ -278,6 +305,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Output number | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -295,7 +327,7 @@ Test serialization of outer string types
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -305,9 +337,10 @@ namespace Example
|
||||
{
|
||||
public class FakeOuterStringSerializeExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var body = body_example; // string | Input string as post body (optional)
|
||||
|
||||
try
|
||||
@@ -315,9 +348,11 @@ namespace Example
|
||||
string result = apiInstance.FakeOuterStringSerialize(body);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -344,6 +379,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Output string | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -361,7 +401,7 @@ For this test, the body for this request much reference a schema named `File`.
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -371,18 +411,21 @@ namespace Example
|
||||
{
|
||||
public class TestBodyWithFileSchemaExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var body = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
|
||||
try
|
||||
{
|
||||
apiInstance.TestBodyWithFileSchema(body);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -409,6 +452,11 @@ No authorization required
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Success | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -424,7 +472,7 @@ No authorization required
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -434,9 +482,10 @@ namespace Example
|
||||
{
|
||||
public class TestBodyWithQueryParamsExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var query = query_example; // string |
|
||||
var body = new User(); // User |
|
||||
|
||||
@@ -444,9 +493,11 @@ namespace Example
|
||||
{
|
||||
apiInstance.TestBodyWithQueryParams(query, body);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -474,6 +525,11 @@ No authorization required
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Success | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -491,7 +547,7 @@ To test \"client\" model
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -501,9 +557,10 @@ namespace Example
|
||||
{
|
||||
public class TestClientModelExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var body = new ModelClient(); // ModelClient | client model
|
||||
|
||||
try
|
||||
@@ -512,9 +569,11 @@ namespace Example
|
||||
ModelClient result = apiInstance.TestClientModel(body);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -541,6 +600,11 @@ No authorization required
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -549,7 +613,7 @@ No authorization required
|
||||
|
||||
## TestEndpointParameters
|
||||
|
||||
> void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null)
|
||||
> void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = null, int int32 = null, long int64 = null, float _float = null, string _string = null, System.IO.Stream binary = null, DateTime date = null, DateTime dateTime = null, string password = null, string callback = null)
|
||||
|
||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
|
||||
@@ -558,7 +622,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -568,25 +632,26 @@ namespace Example
|
||||
{
|
||||
public class TestEndpointParametersExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// Configure HTTP basic authorization: http_basic_test
|
||||
Configuration.Default.Username = "YOUR_USERNAME";
|
||||
Configuration.Default.Password = "YOUR_PASSWORD";
|
||||
|
||||
var apiInstance = new FakeApi();
|
||||
var number = 8.14; // decimal? | None
|
||||
var _double = 1.2D; // double? | None
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var number = 8.14; // decimal | None
|
||||
var _double = 1.2D; // double | None
|
||||
var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None
|
||||
var _byte = BYTE_ARRAY_DATA_HERE; // byte[] | None
|
||||
var integer = 56; // int? | None (optional)
|
||||
var int32 = 56; // int? | None (optional)
|
||||
var int64 = 789; // long? | None (optional)
|
||||
var _float = 3.4F; // float? | None (optional)
|
||||
var integer = 56; // int | None (optional)
|
||||
var int32 = 56; // int | None (optional)
|
||||
var int64 = 789; // long | None (optional)
|
||||
var _float = 3.4F; // float | None (optional)
|
||||
var _string = _string_example; // string | None (optional)
|
||||
var binary = BINARY_DATA_HERE; // System.IO.Stream | None (optional)
|
||||
var date = 2013-10-20; // DateTime? | None (optional)
|
||||
var dateTime = 2013-10-20T19:20:30+01:00; // DateTime? | None (optional)
|
||||
var date = 2013-10-20; // DateTime | None (optional)
|
||||
var dateTime = 2013-10-20T19:20:30+01:00; // DateTime | None (optional)
|
||||
var password = password_example; // string | None (optional)
|
||||
var callback = callback_example; // string | None (optional)
|
||||
|
||||
@@ -595,9 +660,11 @@ namespace Example
|
||||
// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -609,18 +676,18 @@ namespace Example
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**number** | **decimal?**| None |
|
||||
**_double** | **double?**| None |
|
||||
**number** | **decimal**| None |
|
||||
**_double** | **double**| None |
|
||||
**patternWithoutDelimiter** | **string**| None |
|
||||
**_byte** | **byte[]**| None |
|
||||
**integer** | **int?**| None | [optional]
|
||||
**int32** | **int?**| None | [optional]
|
||||
**int64** | **long?**| None | [optional]
|
||||
**_float** | **float?**| None | [optional]
|
||||
**integer** | **int**| None | [optional]
|
||||
**int32** | **int**| None | [optional]
|
||||
**int64** | **long**| None | [optional]
|
||||
**_float** | **float**| None | [optional]
|
||||
**_string** | **string**| None | [optional]
|
||||
**binary** | **System.IO.Stream**| None | [optional]
|
||||
**date** | **DateTime?**| None | [optional]
|
||||
**dateTime** | **DateTime?**| None | [optional]
|
||||
**date** | **DateTime**| None | [optional]
|
||||
**dateTime** | **DateTime**| None | [optional]
|
||||
**password** | **string**| None | [optional]
|
||||
**callback** | **string**| None | [optional]
|
||||
|
||||
@@ -637,6 +704,12 @@ void (empty response body)
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Invalid username supplied | - |
|
||||
| **404** | User not found | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -645,7 +718,7 @@ void (empty response body)
|
||||
|
||||
## TestEnumParameters
|
||||
|
||||
> void TestEnumParameters (List<string> enumHeaderStringArray = null, string enumHeaderString = null, List<string> enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List<string> enumFormStringArray = null, string enumFormString = null)
|
||||
> void TestEnumParameters (List<string> enumHeaderStringArray = null, string enumHeaderString = null, List<string> enumQueryStringArray = null, string enumQueryString = null, int enumQueryInteger = null, double enumQueryDouble = null, List<string> enumFormStringArray = null, string enumFormString = null)
|
||||
|
||||
To test enum parameters
|
||||
|
||||
@@ -654,7 +727,7 @@ To test enum parameters
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -664,15 +737,16 @@ namespace Example
|
||||
{
|
||||
public class TestEnumParametersExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var enumHeaderStringArray = enumHeaderStringArray_example; // List<string> | Header parameter enum test (string array) (optional)
|
||||
var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg)
|
||||
var enumQueryStringArray = enumQueryStringArray_example; // List<string> | Query parameter enum test (string array) (optional)
|
||||
var enumQueryString = enumQueryString_example; // string | Query parameter enum test (string) (optional) (default to -efg)
|
||||
var enumQueryInteger = 56; // int? | Query parameter enum test (double) (optional)
|
||||
var enumQueryDouble = 1.2D; // double? | Query parameter enum test (double) (optional)
|
||||
var enumQueryInteger = 56; // int | Query parameter enum test (double) (optional)
|
||||
var enumQueryDouble = 1.2D; // double | Query parameter enum test (double) (optional)
|
||||
var enumFormStringArray = new List<string>(); // List<string> | Form parameter enum test (string array) (optional) (default to $)
|
||||
var enumFormString = enumFormString_example; // string | Form parameter enum test (string) (optional) (default to -efg)
|
||||
|
||||
@@ -681,9 +755,11 @@ namespace Example
|
||||
// To test enum parameters
|
||||
apiInstance.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -699,8 +775,8 @@ Name | Type | Description | Notes
|
||||
**enumHeaderString** | **string**| Header parameter enum test (string) | [optional] [default to -efg]
|
||||
**enumQueryStringArray** | **List<string>**| Query parameter enum test (string array) | [optional]
|
||||
**enumQueryString** | **string**| Query parameter enum test (string) | [optional] [default to -efg]
|
||||
**enumQueryInteger** | **int?**| Query parameter enum test (double) | [optional]
|
||||
**enumQueryDouble** | **double?**| Query parameter enum test (double) | [optional]
|
||||
**enumQueryInteger** | **int**| Query parameter enum test (double) | [optional]
|
||||
**enumQueryDouble** | **double**| Query parameter enum test (double) | [optional]
|
||||
**enumFormStringArray** | [**List<string>**](string.md)| Form parameter enum test (string array) | [optional] [default to $]
|
||||
**enumFormString** | **string**| Form parameter enum test (string) | [optional] [default to -efg]
|
||||
|
||||
@@ -717,6 +793,12 @@ No authorization required
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Invalid request | - |
|
||||
| **404** | Not found | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -725,7 +807,7 @@ No authorization required
|
||||
|
||||
## TestGroupParameters
|
||||
|
||||
> void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null)
|
||||
> void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = null, bool booleanGroup = null, long int64Group = null)
|
||||
|
||||
Fake endpoint to test group parameters (optional)
|
||||
|
||||
@@ -734,7 +816,7 @@ Fake endpoint to test group parameters (optional)
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -744,24 +826,27 @@ namespace Example
|
||||
{
|
||||
public class TestGroupParametersExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
var requiredStringGroup = 56; // int? | Required String in group parameters
|
||||
var requiredBooleanGroup = true; // bool? | Required Boolean in group parameters
|
||||
var requiredInt64Group = 789; // long? | Required Integer in group parameters
|
||||
var stringGroup = 56; // int? | String in group parameters (optional)
|
||||
var booleanGroup = true; // bool? | Boolean in group parameters (optional)
|
||||
var int64Group = 789; // long? | Integer in group parameters (optional)
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var requiredStringGroup = 56; // int | Required String in group parameters
|
||||
var requiredBooleanGroup = true; // bool | Required Boolean in group parameters
|
||||
var requiredInt64Group = 789; // long | Required Integer in group parameters
|
||||
var stringGroup = 56; // int | String in group parameters (optional)
|
||||
var booleanGroup = true; // bool | Boolean in group parameters (optional)
|
||||
var int64Group = 789; // long | Integer in group parameters (optional)
|
||||
|
||||
try
|
||||
{
|
||||
// Fake endpoint to test group parameters (optional)
|
||||
apiInstance.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -773,12 +858,12 @@ namespace Example
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**requiredStringGroup** | **int?**| Required String in group parameters |
|
||||
**requiredBooleanGroup** | **bool?**| Required Boolean in group parameters |
|
||||
**requiredInt64Group** | **long?**| Required Integer in group parameters |
|
||||
**stringGroup** | **int?**| String in group parameters | [optional]
|
||||
**booleanGroup** | **bool?**| Boolean in group parameters | [optional]
|
||||
**int64Group** | **long?**| Integer in group parameters | [optional]
|
||||
**requiredStringGroup** | **int**| Required String in group parameters |
|
||||
**requiredBooleanGroup** | **bool**| Required Boolean in group parameters |
|
||||
**requiredInt64Group** | **long**| Required Integer in group parameters |
|
||||
**stringGroup** | **int**| String in group parameters | [optional]
|
||||
**booleanGroup** | **bool**| Boolean in group parameters | [optional]
|
||||
**int64Group** | **long**| Integer in group parameters | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -793,6 +878,11 @@ No authorization required
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Someting wrong | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -808,7 +898,7 @@ test inline additionalProperties
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -818,9 +908,10 @@ namespace Example
|
||||
{
|
||||
public class TestInlineAdditionalPropertiesExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var param = new Dictionary<string, string>(); // Dictionary<string, string> | request body
|
||||
|
||||
try
|
||||
@@ -828,9 +919,11 @@ namespace Example
|
||||
// test inline additionalProperties
|
||||
apiInstance.TestInlineAdditionalProperties(param);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -857,6 +950,11 @@ No authorization required
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
@@ -872,7 +970,7 @@ test json serialization of form data
|
||||
### Example
|
||||
|
||||
```csharp
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
@@ -882,9 +980,10 @@ namespace Example
|
||||
{
|
||||
public class TestJsonFormDataExample
|
||||
{
|
||||
public void main()
|
||||
public static void Main()
|
||||
{
|
||||
var apiInstance = new FakeApi();
|
||||
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new FakeApi(Configuration.Default);
|
||||
var param = param_example; // string | field1
|
||||
var param2 = param2_example; // string | field2
|
||||
|
||||
@@ -893,9 +992,11 @@ namespace Example
|
||||
// test json serialization of form data
|
||||
apiInstance.TestJsonFormData(param, param2);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message );
|
||||
Debug.Print("Status Code: "+ e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -923,6 +1024,11 @@ No authorization required
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
[[Back to top]](#)
|
||||
[[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||
[[Back to Model list]](../README.md#documentation-for-models)
|
||||
|
||||
Reference in New Issue
Block a user