[csharp] Fixed model property data type (#16315)

* fixed model property data type

* build samples
This commit is contained in:
devhl-labs
2023-08-14 21:57:00 -04:00
committed by GitHub
parent 35fec8da0e
commit 76bb8a40d8
90 changed files with 5894 additions and 10 deletions

View File

@@ -53,6 +53,7 @@ docs/MixedPropertiesAndAdditionalPropertiesClass.md
docs/Model200Response.md
docs/ModelClient.md
docs/Name.md
docs/NotificationtestGetElementsV1ResponseMPayload.md
docs/NullableClass.md
docs/NullableGuidClass.md
docs/NullableShape.md
@@ -170,6 +171,7 @@ src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs
src/Org.OpenAPITools/Model/Model200Response.cs
src/Org.OpenAPITools/Model/ModelClient.cs
src/Org.OpenAPITools/Model/Name.cs
src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs
src/Org.OpenAPITools/Model/NullableClass.cs
src/Org.OpenAPITools/Model/NullableGuidClass.cs
src/Org.OpenAPITools/Model/NullableShape.cs

View File

@@ -94,6 +94,7 @@ Class | Method | HTTP request | Description
*DefaultApi* | [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country |
*DefaultApi* | [**Hello**](DefaultApi.md#hello) | **GET** /hello | Hello
*DefaultApi* | [**RolesReportGet**](DefaultApi.md#rolesreportget) | **GET** /roles/report |
*DefaultApi* | [**Test**](DefaultApi.md#test) | **GET** /test | Retrieve an existing Notificationtest's Elements
*FakeApi* | [**FakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint
*FakeApi* | [**FakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean |
*FakeApi* | [**FakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
@@ -184,6 +185,7 @@ Class | Method | HTTP request | Description
- [Model.Model200Response](Model200Response.md)
- [Model.ModelClient](ModelClient.md)
- [Model.Name](Name.md)
- [Model.NotificationtestGetElementsV1ResponseMPayload](NotificationtestGetElementsV1ResponseMPayload.md)
- [Model.NullableClass](NullableClass.md)
- [Model.NullableGuidClass](NullableGuidClass.md)
- [Model.NullableShape](NullableShape.md)

View File

@@ -1156,6 +1156,17 @@ paths:
responses:
"200":
description: OK
/test:
get:
operationId: Test
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/notificationtest-getElements-v1-Response-mPayload'
description: Successful response
summary: Retrieve an existing Notificationtest's Elements
components:
requestBodies:
UserArray:
@@ -2294,6 +2305,29 @@ components:
- notUnknown
type: string
type: object
Custom-Variableobject-Response:
additionalProperties: true
description: A Variable object without predefined property names
type: object
Field-pkiNotificationtestID:
type: integer
notificationtest-getElements-v1-Response-mPayload:
example:
a_objVariableobject:
- null
- null
pkiNotificationtestID: 0
properties:
pkiNotificationtestID:
type: integer
a_objVariableobject:
items:
$ref: '#/components/schemas/Custom-Variableobject-Response'
type: array
required:
- a_objVariableobject
- pkiNotificationtestID
type: object
_foo_get_default_response:
example:
string:

View File

@@ -8,6 +8,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
| [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | |
| [**Hello**](DefaultApi.md#hello) | **GET** /hello | Hello |
| [**RolesReportGet**](DefaultApi.md#rolesreportget) | **GET** /roles/report | |
| [**Test**](DefaultApi.md#test) | **GET** /test | Retrieve an existing Notificationtest's Elements |
<a id="fooget"></a>
# **FooGet**
@@ -342,3 +343,87 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
<a id="test"></a>
# **Test**
> NotificationtestGetElementsV1ResponseMPayload Test ()
Retrieve an existing Notificationtest's Elements
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class TestExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new DefaultApi(config);
try
{
// Retrieve an existing Notificationtest's Elements
NotificationtestGetElementsV1ResponseMPayload result = apiInstance.Test();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.Test: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the TestWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// Retrieve an existing Notificationtest's Elements
ApiResponse<NotificationtestGetElementsV1ResponseMPayload> response = apiInstance.TestWithHttpInfo();
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.TestWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**NotificationtestGetElementsV1ResponseMPayload**](NotificationtestGetElementsV1ResponseMPayload.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Successful response | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**PkiNotificationtestID** | **int** | |
**AObjVariableobject** | **List&lt;Dictionary&lt;string, Object&gt;&gt;** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,74 @@
/*
* OpenAPI Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Model;
using Org.OpenAPITools.Client;
using System.Reflection;
using Newtonsoft.Json;
using NUnit.Framework;
namespace Org.OpenAPITools.Test.Model
{
/// <summary>
/// Class for testing NotificationtestGetElementsV1ResponseMPayload
/// </summary>
/// <remarks>
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
public class NotificationtestGetElementsV1ResponseMPayloadTests : IDisposable
{
// TODO uncomment below to declare an instance variable for NotificationtestGetElementsV1ResponseMPayload
//private NotificationtestGetElementsV1ResponseMPayload instance;
public NotificationtestGetElementsV1ResponseMPayloadTests()
{
// TODO uncomment below to create an instance of NotificationtestGetElementsV1ResponseMPayload
//instance = new NotificationtestGetElementsV1ResponseMPayload();
}
public void Dispose()
{
// Cleanup when everything is done.
}
/// <summary>
/// Test an instance of NotificationtestGetElementsV1ResponseMPayload
/// </summary>
[Test]
public void NotificationtestGetElementsV1ResponseMPayloadInstanceTest()
{
// TODO uncomment below to test "IsType" NotificationtestGetElementsV1ResponseMPayload
//Assert.IsType<NotificationtestGetElementsV1ResponseMPayload>(instance);
}
/// <summary>
/// Test the property 'PkiNotificationtestID'
/// </summary>
[Test]
public void PkiNotificationtestIDTest()
{
// TODO unit test for the property 'PkiNotificationtestID'
}
/// <summary>
/// Test the property 'AObjVariableobject'
/// </summary>
[Test]
public void AObjVariableobjectTest()
{
// TODO unit test for the property 'AObjVariableobject'
}
}
}

View File

@@ -95,6 +95,22 @@ namespace Org.OpenAPITools.Api
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>ApiResponse of List&lt;List&lt;RolesReportsHash&gt;&gt;</returns>
ApiResponse<List<List<RolesReportsHash>>> RolesReportGetWithHttpInfo();
/// <summary>
/// Retrieve an existing Notificationtest&#39;s Elements
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>NotificationtestGetElementsV1ResponseMPayload</returns>
NotificationtestGetElementsV1ResponseMPayload Test();
/// <summary>
/// Retrieve an existing Notificationtest&#39;s Elements
/// </summary>
/// <remarks>
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>ApiResponse of NotificationtestGetElementsV1ResponseMPayload</returns>
ApiResponse<NotificationtestGetElementsV1ResponseMPayload> TestWithHttpInfo();
#endregion Synchronous Operations
}
@@ -190,6 +206,27 @@ namespace Org.OpenAPITools.Api
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (List&lt;List&lt;RolesReportsHash&gt;&gt;)</returns>
System.Threading.Tasks.Task<ApiResponse<List<List<RolesReportsHash>>>> RolesReportGetWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
/// Retrieve an existing Notificationtest&#39;s Elements
/// </summary>
/// <remarks>
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of NotificationtestGetElementsV1ResponseMPayload</returns>
System.Threading.Tasks.Task<NotificationtestGetElementsV1ResponseMPayload> TestAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
/// Retrieve an existing Notificationtest&#39;s Elements
/// </summary>
/// <remarks>
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (NotificationtestGetElementsV1ResponseMPayload)</returns>
System.Threading.Tasks.Task<ApiResponse<NotificationtestGetElementsV1ResponseMPayload>> TestWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
#endregion Asynchronous Operations
}
@@ -794,5 +831,117 @@ namespace Org.OpenAPITools.Api
return localVarResponse;
}
/// <summary>
/// Retrieve an existing Notificationtest&#39;s Elements
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>NotificationtestGetElementsV1ResponseMPayload</returns>
public NotificationtestGetElementsV1ResponseMPayload Test()
{
Org.OpenAPITools.Client.ApiResponse<NotificationtestGetElementsV1ResponseMPayload> localVarResponse = TestWithHttpInfo();
return localVarResponse.Data;
}
/// <summary>
/// Retrieve an existing Notificationtest&#39;s Elements
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>ApiResponse of NotificationtestGetElementsV1ResponseMPayload</returns>
public Org.OpenAPITools.Client.ApiResponse<NotificationtestGetElementsV1ResponseMPayload> TestWithHttpInfo()
{
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
string[] _contentTypes = new string[] {
};
// to determine the Accept header
string[] _accepts = new string[] {
"application/json"
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
// make the HTTP request
var localVarResponse = this.Client.Get<NotificationtestGetElementsV1ResponseMPayload>("/test", localVarRequestOptions, this.Configuration);
if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("Test", localVarResponse);
if (_exception != null) throw _exception;
}
return localVarResponse;
}
/// <summary>
/// Retrieve an existing Notificationtest&#39;s Elements
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of NotificationtestGetElementsV1ResponseMPayload</returns>
public async System.Threading.Tasks.Task<NotificationtestGetElementsV1ResponseMPayload> TestAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
var task = TestWithHttpInfoAsync(cancellationToken);
#if UNITY_EDITOR || !UNITY_WEBGL
Org.OpenAPITools.Client.ApiResponse<NotificationtestGetElementsV1ResponseMPayload> localVarResponse = await task.ConfigureAwait(false);
#else
Org.OpenAPITools.Client.ApiResponse<NotificationtestGetElementsV1ResponseMPayload> localVarResponse = await task;
#endif
return localVarResponse.Data;
}
/// <summary>
/// Retrieve an existing Notificationtest&#39;s Elements
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (NotificationtestGetElementsV1ResponseMPayload)</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<NotificationtestGetElementsV1ResponseMPayload>> TestWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
string[] _contentTypes = new string[] {
};
// to determine the Accept header
string[] _accepts = new string[] {
"application/json"
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
// make the HTTP request
var task = this.AsynchronousClient.GetAsync<NotificationtestGetElementsV1ResponseMPayload>("/test", localVarRequestOptions, this.Configuration, cancellationToken);
#if UNITY_EDITOR || !UNITY_WEBGL
var localVarResponse = await task.ConfigureAwait(false);
#else
var localVarResponse = await task;
#endif
if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("Test", localVarResponse);
if (_exception != null) throw _exception;
}
return localVarResponse;
}
}
}

View File

@@ -0,0 +1,143 @@
/*
* OpenAPI Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
namespace Org.OpenAPITools.Model
{
/// <summary>
/// NotificationtestGetElementsV1ResponseMPayload
/// </summary>
[DataContract(Name = "notificationtest-getElements-v1-Response-mPayload")]
public partial class NotificationtestGetElementsV1ResponseMPayload : IEquatable<NotificationtestGetElementsV1ResponseMPayload>
{
/// <summary>
/// Initializes a new instance of the <see cref="NotificationtestGetElementsV1ResponseMPayload" /> class.
/// </summary>
[JsonConstructorAttribute]
protected NotificationtestGetElementsV1ResponseMPayload() { }
/// <summary>
/// Initializes a new instance of the <see cref="NotificationtestGetElementsV1ResponseMPayload" /> class.
/// </summary>
/// <param name="pkiNotificationtestID">pkiNotificationtestID (required).</param>
/// <param name="aObjVariableobject">aObjVariableobject (required).</param>
public NotificationtestGetElementsV1ResponseMPayload(int pkiNotificationtestID = default(int), List<Dictionary<string, Object>> aObjVariableobject = default(List<Dictionary<string, Object>>))
{
this.PkiNotificationtestID = pkiNotificationtestID;
// to ensure "aObjVariableobject" is required (not null)
if (aObjVariableobject == null)
{
throw new ArgumentNullException("aObjVariableobject is a required property for NotificationtestGetElementsV1ResponseMPayload and cannot be null");
}
this.AObjVariableobject = aObjVariableobject;
}
/// <summary>
/// Gets or Sets PkiNotificationtestID
/// </summary>
[DataMember(Name = "pkiNotificationtestID", IsRequired = true, EmitDefaultValue = true)]
public int PkiNotificationtestID { get; set; }
/// <summary>
/// Gets or Sets AObjVariableobject
/// </summary>
[DataMember(Name = "a_objVariableobject", IsRequired = true, EmitDefaultValue = true)]
public List<Dictionary<string, Object>> AObjVariableobject { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class NotificationtestGetElementsV1ResponseMPayload {\n");
sb.Append(" PkiNotificationtestID: ").Append(PkiNotificationtestID).Append("\n");
sb.Append(" AObjVariableobject: ").Append(AObjVariableobject).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as NotificationtestGetElementsV1ResponseMPayload);
}
/// <summary>
/// Returns true if NotificationtestGetElementsV1ResponseMPayload instances are equal
/// </summary>
/// <param name="input">Instance of NotificationtestGetElementsV1ResponseMPayload to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(NotificationtestGetElementsV1ResponseMPayload input)
{
if (input == null)
{
return false;
}
return
(
this.PkiNotificationtestID == input.PkiNotificationtestID ||
this.PkiNotificationtestID.Equals(input.PkiNotificationtestID)
) &&
(
this.AObjVariableobject == input.AObjVariableobject ||
this.AObjVariableobject != null &&
input.AObjVariableobject != null &&
this.AObjVariableobject.SequenceEqual(input.AObjVariableobject)
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
hashCode = (hashCode * 59) + this.PkiNotificationtestID.GetHashCode();
if (this.AObjVariableobject != null)
{
hashCode = (hashCode * 59) + this.AObjVariableobject.GetHashCode();
}
return hashCode;
}
}
}
}