forked from loafle/openapi-generator-original
[csharp-netcore] Zero based inner enum sample (#15506)
* added to the sample * build samples again
This commit is contained in:
parent
c5a1dbecfb
commit
cc1226c0db
@ -2284,3 +2284,11 @@ components:
|
||||
enum:
|
||||
- unknown
|
||||
- notUnknown
|
||||
ZeroBasedEnumClass:
|
||||
type: object
|
||||
properties:
|
||||
ZeroBasedEnum:
|
||||
type: string
|
||||
enum:
|
||||
- unknown
|
||||
- notUnknown
|
@ -96,6 +96,7 @@ docs/UserApi.md
|
||||
docs/Whale.md
|
||||
docs/Zebra.md
|
||||
docs/ZeroBasedEnum.md
|
||||
docs/ZeroBasedEnumClass.md
|
||||
git_push.sh
|
||||
src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj
|
||||
src/Org.OpenAPITools/Api/AnotherFakeApi.cs
|
||||
@ -212,4 +213,5 @@ src/Org.OpenAPITools/Model/User.cs
|
||||
src/Org.OpenAPITools/Model/Whale.cs
|
||||
src/Org.OpenAPITools/Model/Zebra.cs
|
||||
src/Org.OpenAPITools/Model/ZeroBasedEnum.cs
|
||||
src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs
|
||||
src/Org.OpenAPITools/Org.OpenAPITools.csproj
|
||||
|
@ -235,6 +235,7 @@ Class | Method | HTTP request | Description
|
||||
- [Model.Whale](docs/Whale.md)
|
||||
- [Model.Zebra](docs/Zebra.md)
|
||||
- [Model.ZeroBasedEnum](docs/ZeroBasedEnum.md)
|
||||
- [Model.ZeroBasedEnumClass](docs/ZeroBasedEnumClass.md)
|
||||
|
||||
|
||||
<a id="documentation-for-authorization"></a>
|
||||
|
@ -2211,6 +2211,14 @@ components:
|
||||
- unknown
|
||||
- notUnknown
|
||||
type: string
|
||||
ZeroBasedEnumClass:
|
||||
properties:
|
||||
ZeroBasedEnum:
|
||||
enum:
|
||||
- unknown
|
||||
- notUnknown
|
||||
type: string
|
||||
type: object
|
||||
_foo_get_default_response:
|
||||
example:
|
||||
string:
|
||||
|
@ -0,0 +1,10 @@
|
||||
# Org.OpenAPITools.Model.ZeroBasedEnumClass
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ZeroBasedEnum** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
@ -0,0 +1,69 @@
|
||||
/*
|
||||
* 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 Xunit;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Org.OpenAPITools.Model;
|
||||
using Org.OpenAPITools.Client;
|
||||
using System.Reflection;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing ZeroBasedEnumClass
|
||||
/// </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 ZeroBasedEnumClassTests : IDisposable
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for ZeroBasedEnumClass
|
||||
//private ZeroBasedEnumClass instance;
|
||||
|
||||
public ZeroBasedEnumClassTests()
|
||||
{
|
||||
// TODO uncomment below to create an instance of ZeroBasedEnumClass
|
||||
//instance = new ZeroBasedEnumClass();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of ZeroBasedEnumClass
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ZeroBasedEnumClassInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsType" ZeroBasedEnumClass
|
||||
//Assert.IsType<ZeroBasedEnumClass>(instance);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ZeroBasedEnum'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ZeroBasedEnumTest()
|
||||
{
|
||||
// TODO unit test for the property 'ZeroBasedEnum'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,173 @@
|
||||
/*
|
||||
* 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 System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// ZeroBasedEnumClass
|
||||
/// </summary>
|
||||
[DataContract(Name = "ZeroBasedEnumClass")]
|
||||
public partial class ZeroBasedEnumClass : IEquatable<ZeroBasedEnumClass>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines ZeroBasedEnum
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum ZeroBasedEnumEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum Unknown for value: unknown
|
||||
/// </summary>
|
||||
[EnumMember(Value = "unknown")]
|
||||
Unknown,
|
||||
|
||||
/// <summary>
|
||||
/// Enum NotUnknown for value: notUnknown
|
||||
/// </summary>
|
||||
[EnumMember(Value = "notUnknown")]
|
||||
NotUnknown
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ZeroBasedEnum
|
||||
/// </summary>
|
||||
|
||||
[DataMember(Name = "ZeroBasedEnum", EmitDefaultValue = false)]
|
||||
public ZeroBasedEnumEnum? ZeroBasedEnum
|
||||
{
|
||||
get{ return _ZeroBasedEnum;}
|
||||
set
|
||||
{
|
||||
_ZeroBasedEnum = value;
|
||||
_flagZeroBasedEnum = true;
|
||||
}
|
||||
}
|
||||
private ZeroBasedEnumEnum? _ZeroBasedEnum;
|
||||
private bool _flagZeroBasedEnum;
|
||||
|
||||
/// <summary>
|
||||
/// Returns false as ZeroBasedEnum should not be serialized given that it's read-only.
|
||||
/// </summary>
|
||||
/// <returns>false (boolean)</returns>
|
||||
public bool ShouldSerializeZeroBasedEnum()
|
||||
{
|
||||
return _flagZeroBasedEnum;
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ZeroBasedEnumClass" /> class.
|
||||
/// </summary>
|
||||
/// <param name="zeroBasedEnum">zeroBasedEnum.</param>
|
||||
public ZeroBasedEnumClass(ZeroBasedEnumEnum? zeroBasedEnum = default(ZeroBasedEnumEnum?))
|
||||
{
|
||||
this._ZeroBasedEnum = zeroBasedEnum;
|
||||
if (this.ZeroBasedEnum != null)
|
||||
{
|
||||
this._flagZeroBasedEnum = true;
|
||||
}
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { 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 ZeroBasedEnumClass {\n");
|
||||
sb.Append(" ZeroBasedEnum: ").Append(ZeroBasedEnum).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).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 OpenAPIClientUtils.compareLogic.Compare(this, input as ZeroBasedEnumClass).AreEqual;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if ZeroBasedEnumClass instances are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of ZeroBasedEnumClass to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(ZeroBasedEnumClass input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
/// <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.ZeroBasedEnum.GetHashCode();
|
||||
if (this.AdditionalProperties != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -96,6 +96,7 @@ docs/models/User.md
|
||||
docs/models/Whale.md
|
||||
docs/models/Zebra.md
|
||||
docs/models/ZeroBasedEnum.md
|
||||
docs/models/ZeroBasedEnumClass.md
|
||||
docs/scripts/git_push.ps1
|
||||
docs/scripts/git_push.sh
|
||||
src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs
|
||||
@ -218,5 +219,6 @@ src/Org.OpenAPITools/Model/User.cs
|
||||
src/Org.OpenAPITools/Model/Whale.cs
|
||||
src/Org.OpenAPITools/Model/Zebra.cs
|
||||
src/Org.OpenAPITools/Model/ZeroBasedEnum.cs
|
||||
src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs
|
||||
src/Org.OpenAPITools/Org.OpenAPITools.csproj
|
||||
src/Org.OpenAPITools/README.md
|
||||
|
@ -2211,6 +2211,14 @@ components:
|
||||
- unknown
|
||||
- notUnknown
|
||||
type: string
|
||||
ZeroBasedEnumClass:
|
||||
properties:
|
||||
ZeroBasedEnum:
|
||||
enum:
|
||||
- unknown
|
||||
- notUnknown
|
||||
type: string
|
||||
type: object
|
||||
_foo_get_default_response:
|
||||
example:
|
||||
string:
|
||||
|
@ -0,0 +1,10 @@
|
||||
# Org.OpenAPITools.Model.ZeroBasedEnumClass
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ZeroBasedEnum** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
@ -0,0 +1,68 @@
|
||||
/*
|
||||
* 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 Xunit;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Org.OpenAPITools.Model;
|
||||
using Org.OpenAPITools.Client;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing ZeroBasedEnumClass
|
||||
/// </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 ZeroBasedEnumClassTests : IDisposable
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for ZeroBasedEnumClass
|
||||
//private ZeroBasedEnumClass instance;
|
||||
|
||||
public ZeroBasedEnumClassTests()
|
||||
{
|
||||
// TODO uncomment below to create an instance of ZeroBasedEnumClass
|
||||
//instance = new ZeroBasedEnumClass();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of ZeroBasedEnumClass
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ZeroBasedEnumClassInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsType" ZeroBasedEnumClass
|
||||
//Assert.IsType<ZeroBasedEnumClass>(instance);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ZeroBasedEnum'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ZeroBasedEnumTest()
|
||||
{
|
||||
// TODO unit test for the property 'ZeroBasedEnum'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -166,6 +166,8 @@ namespace Org.OpenAPITools.Client
|
||||
return Zebra.TypeEnumToJsonValue(zebraTypeEnum);
|
||||
if (obj is ZeroBasedEnum zeroBasedEnum)
|
||||
return ZeroBasedEnumConverter.ToJsonValue(zeroBasedEnum);
|
||||
if (obj is ZeroBasedEnumClass.ZeroBasedEnumEnum zeroBasedEnumClassZeroBasedEnumEnum)
|
||||
return ZeroBasedEnumClass.ZeroBasedEnumEnumToJsonValue(zeroBasedEnumClassZeroBasedEnumEnum);
|
||||
if (obj is ICollection collection)
|
||||
{
|
||||
List<string?> entries = new List<string?>();
|
||||
|
@ -139,6 +139,7 @@ namespace Org.OpenAPITools.Client
|
||||
_jsonOptions.Converters.Add(new ZebraJsonConverter());
|
||||
_jsonOptions.Converters.Add(new ZeroBasedEnumConverter());
|
||||
_jsonOptions.Converters.Add(new ZeroBasedEnumNullableConverter());
|
||||
_jsonOptions.Converters.Add(new ZeroBasedEnumClassJsonConverter());
|
||||
_services.AddSingleton(new JsonSerializerOptionsProvider(_jsonOptions));
|
||||
_services.AddSingleton<IApiFactory, ApiFactory>();
|
||||
_services.AddTransient<TAnotherFakeApi, TAnotherFakeApi>();
|
||||
|
@ -0,0 +1,214 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// ZeroBasedEnumClass
|
||||
/// </summary>
|
||||
public partial class ZeroBasedEnumClass : IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ZeroBasedEnumClass" /> class.
|
||||
/// </summary>
|
||||
/// <param name="zeroBasedEnum">zeroBasedEnum</param>
|
||||
[JsonConstructor]
|
||||
public ZeroBasedEnumClass(ZeroBasedEnumEnum zeroBasedEnum)
|
||||
{
|
||||
ZeroBasedEnum = zeroBasedEnum;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Defines ZeroBasedEnum
|
||||
/// </summary>
|
||||
public enum ZeroBasedEnumEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum Unknown for value: unknown
|
||||
/// </summary>
|
||||
Unknown,
|
||||
|
||||
/// <summary>
|
||||
/// Enum NotUnknown for value: notUnknown
|
||||
/// </summary>
|
||||
NotUnknown
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a ZeroBasedEnumEnum
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static ZeroBasedEnumEnum ZeroBasedEnumEnumFromString(string value)
|
||||
{
|
||||
if (value == "unknown")
|
||||
return ZeroBasedEnumEnum.Unknown;
|
||||
|
||||
if (value == "notUnknown")
|
||||
return ZeroBasedEnumEnum.NotUnknown;
|
||||
|
||||
throw new NotImplementedException($"Could not convert value to type ZeroBasedEnumEnum: '{value}'");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns equivalent json value
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public static string ZeroBasedEnumEnumToJsonValue(ZeroBasedEnumEnum value)
|
||||
{
|
||||
if (value == ZeroBasedEnumEnum.Unknown)
|
||||
return "unknown";
|
||||
|
||||
if (value == ZeroBasedEnumEnum.NotUnknown)
|
||||
return "notUnknown";
|
||||
|
||||
throw new NotImplementedException($"Value could not be handled: '{value}'");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ZeroBasedEnum
|
||||
/// </summary>
|
||||
[JsonPropertyName("ZeroBasedEnum")]
|
||||
public ZeroBasedEnumEnum ZeroBasedEnum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <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 ZeroBasedEnumClass {\n");
|
||||
sb.Append(" ZeroBasedEnum: ").Append(ZeroBasedEnum).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A Json converter for type ZeroBasedEnumClass
|
||||
/// </summary>
|
||||
public class ZeroBasedEnumClassJsonConverter : JsonConverter<ZeroBasedEnumClass>
|
||||
{
|
||||
/// <summary>
|
||||
/// A Json reader.
|
||||
/// </summary>
|
||||
/// <param name="utf8JsonReader"></param>
|
||||
/// <param name="typeToConvert"></param>
|
||||
/// <param name="jsonSerializerOptions"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="JsonException"></exception>
|
||||
public override ZeroBasedEnumClass Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||
|
||||
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||
throw new JsonException();
|
||||
|
||||
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||
|
||||
ZeroBasedEnumClass.ZeroBasedEnumEnum zeroBasedEnum = default;
|
||||
|
||||
while (utf8JsonReader.Read())
|
||||
{
|
||||
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||
break;
|
||||
|
||||
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||
break;
|
||||
|
||||
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||
{
|
||||
string? propertyName = utf8JsonReader.GetString();
|
||||
utf8JsonReader.Read();
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
case "ZeroBasedEnum":
|
||||
string zeroBasedEnumRawValue = utf8JsonReader.GetString();
|
||||
zeroBasedEnum = ZeroBasedEnumClass.ZeroBasedEnumEnumFromString(zeroBasedEnumRawValue);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
|
||||
if (zeroBasedEnum == null)
|
||||
throw new ArgumentNullException(nameof(zeroBasedEnum), "Property is required for class ZeroBasedEnumClass.");
|
||||
|
||||
#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
|
||||
return new ZeroBasedEnumClass(zeroBasedEnum);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A Json writer
|
||||
/// </summary>
|
||||
/// <param name="writer"></param>
|
||||
/// <param name="zeroBasedEnumClass"></param>
|
||||
/// <param name="jsonSerializerOptions"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, ZeroBasedEnumClass zeroBasedEnumClass, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
|
||||
var zeroBasedEnumRawValue = ZeroBasedEnumClass.ZeroBasedEnumEnumToJsonValue(zeroBasedEnumClass.ZeroBasedEnum);
|
||||
if (zeroBasedEnumRawValue != null)
|
||||
writer.WriteString("ZeroBasedEnum", zeroBasedEnumRawValue);
|
||||
else
|
||||
writer.WriteNull("ZeroBasedEnum");
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
@ -96,6 +96,7 @@ docs/models/User.md
|
||||
docs/models/Whale.md
|
||||
docs/models/Zebra.md
|
||||
docs/models/ZeroBasedEnum.md
|
||||
docs/models/ZeroBasedEnumClass.md
|
||||
docs/scripts/git_push.ps1
|
||||
docs/scripts/git_push.sh
|
||||
src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs
|
||||
@ -218,5 +219,6 @@ src/Org.OpenAPITools/Model/User.cs
|
||||
src/Org.OpenAPITools/Model/Whale.cs
|
||||
src/Org.OpenAPITools/Model/Zebra.cs
|
||||
src/Org.OpenAPITools/Model/ZeroBasedEnum.cs
|
||||
src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs
|
||||
src/Org.OpenAPITools/Org.OpenAPITools.csproj
|
||||
src/Org.OpenAPITools/README.md
|
||||
|
@ -2211,6 +2211,14 @@ components:
|
||||
- unknown
|
||||
- notUnknown
|
||||
type: string
|
||||
ZeroBasedEnumClass:
|
||||
properties:
|
||||
ZeroBasedEnum:
|
||||
enum:
|
||||
- unknown
|
||||
- notUnknown
|
||||
type: string
|
||||
type: object
|
||||
_foo_get_default_response:
|
||||
example:
|
||||
string:
|
||||
|
@ -0,0 +1,10 @@
|
||||
# Org.OpenAPITools.Model.ZeroBasedEnumClass
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ZeroBasedEnum** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
@ -0,0 +1,68 @@
|
||||
/*
|
||||
* 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 Xunit;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Org.OpenAPITools.Model;
|
||||
using Org.OpenAPITools.Client;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing ZeroBasedEnumClass
|
||||
/// </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 ZeroBasedEnumClassTests : IDisposable
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for ZeroBasedEnumClass
|
||||
//private ZeroBasedEnumClass instance;
|
||||
|
||||
public ZeroBasedEnumClassTests()
|
||||
{
|
||||
// TODO uncomment below to create an instance of ZeroBasedEnumClass
|
||||
//instance = new ZeroBasedEnumClass();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of ZeroBasedEnumClass
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ZeroBasedEnumClassInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsType" ZeroBasedEnumClass
|
||||
//Assert.IsType<ZeroBasedEnumClass>(instance);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ZeroBasedEnum'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ZeroBasedEnumTest()
|
||||
{
|
||||
// TODO unit test for the property 'ZeroBasedEnum'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -164,6 +164,8 @@ namespace Org.OpenAPITools.Client
|
||||
return Zebra.TypeEnumToJsonValue(zebraTypeEnum);
|
||||
if (obj is ZeroBasedEnum zeroBasedEnum)
|
||||
return ZeroBasedEnumConverter.ToJsonValue(zeroBasedEnum);
|
||||
if (obj is ZeroBasedEnumClass.ZeroBasedEnumEnum zeroBasedEnumClassZeroBasedEnumEnum)
|
||||
return ZeroBasedEnumClass.ZeroBasedEnumEnumToJsonValue(zeroBasedEnumClassZeroBasedEnumEnum);
|
||||
if (obj is ICollection collection)
|
||||
{
|
||||
List<string> entries = new List<string>();
|
||||
|
@ -137,6 +137,7 @@ namespace Org.OpenAPITools.Client
|
||||
_jsonOptions.Converters.Add(new ZebraJsonConverter());
|
||||
_jsonOptions.Converters.Add(new ZeroBasedEnumConverter());
|
||||
_jsonOptions.Converters.Add(new ZeroBasedEnumNullableConverter());
|
||||
_jsonOptions.Converters.Add(new ZeroBasedEnumClassJsonConverter());
|
||||
_services.AddSingleton(new JsonSerializerOptionsProvider(_jsonOptions));
|
||||
_services.AddSingleton<IApiFactory, ApiFactory>();
|
||||
_services.AddTransient<TAnotherFakeApi, TAnotherFakeApi>();
|
||||
|
@ -0,0 +1,212 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* 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.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// ZeroBasedEnumClass
|
||||
/// </summary>
|
||||
public partial class ZeroBasedEnumClass : IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ZeroBasedEnumClass" /> class.
|
||||
/// </summary>
|
||||
/// <param name="zeroBasedEnum">zeroBasedEnum</param>
|
||||
[JsonConstructor]
|
||||
public ZeroBasedEnumClass(ZeroBasedEnumEnum zeroBasedEnum)
|
||||
{
|
||||
ZeroBasedEnum = zeroBasedEnum;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Defines ZeroBasedEnum
|
||||
/// </summary>
|
||||
public enum ZeroBasedEnumEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum Unknown for value: unknown
|
||||
/// </summary>
|
||||
Unknown,
|
||||
|
||||
/// <summary>
|
||||
/// Enum NotUnknown for value: notUnknown
|
||||
/// </summary>
|
||||
NotUnknown
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a ZeroBasedEnumEnum
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static ZeroBasedEnumEnum ZeroBasedEnumEnumFromString(string value)
|
||||
{
|
||||
if (value == "unknown")
|
||||
return ZeroBasedEnumEnum.Unknown;
|
||||
|
||||
if (value == "notUnknown")
|
||||
return ZeroBasedEnumEnum.NotUnknown;
|
||||
|
||||
throw new NotImplementedException($"Could not convert value to type ZeroBasedEnumEnum: '{value}'");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns equivalent json value
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public static string ZeroBasedEnumEnumToJsonValue(ZeroBasedEnumEnum value)
|
||||
{
|
||||
if (value == ZeroBasedEnumEnum.Unknown)
|
||||
return "unknown";
|
||||
|
||||
if (value == ZeroBasedEnumEnum.NotUnknown)
|
||||
return "notUnknown";
|
||||
|
||||
throw new NotImplementedException($"Value could not be handled: '{value}'");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ZeroBasedEnum
|
||||
/// </summary>
|
||||
[JsonPropertyName("ZeroBasedEnum")]
|
||||
public ZeroBasedEnumEnum ZeroBasedEnum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <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 ZeroBasedEnumClass {\n");
|
||||
sb.Append(" ZeroBasedEnum: ").Append(ZeroBasedEnum).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A Json converter for type ZeroBasedEnumClass
|
||||
/// </summary>
|
||||
public class ZeroBasedEnumClassJsonConverter : JsonConverter<ZeroBasedEnumClass>
|
||||
{
|
||||
/// <summary>
|
||||
/// A Json reader.
|
||||
/// </summary>
|
||||
/// <param name="utf8JsonReader"></param>
|
||||
/// <param name="typeToConvert"></param>
|
||||
/// <param name="jsonSerializerOptions"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="JsonException"></exception>
|
||||
public override ZeroBasedEnumClass Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||
|
||||
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||
throw new JsonException();
|
||||
|
||||
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||
|
||||
ZeroBasedEnumClass.ZeroBasedEnumEnum zeroBasedEnum = default;
|
||||
|
||||
while (utf8JsonReader.Read())
|
||||
{
|
||||
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||
break;
|
||||
|
||||
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||
break;
|
||||
|
||||
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||
{
|
||||
string propertyName = utf8JsonReader.GetString();
|
||||
utf8JsonReader.Read();
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
case "ZeroBasedEnum":
|
||||
string zeroBasedEnumRawValue = utf8JsonReader.GetString();
|
||||
zeroBasedEnum = ZeroBasedEnumClass.ZeroBasedEnumEnumFromString(zeroBasedEnumRawValue);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
|
||||
if (zeroBasedEnum == null)
|
||||
throw new ArgumentNullException(nameof(zeroBasedEnum), "Property is required for class ZeroBasedEnumClass.");
|
||||
|
||||
#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
|
||||
return new ZeroBasedEnumClass(zeroBasedEnum);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A Json writer
|
||||
/// </summary>
|
||||
/// <param name="writer"></param>
|
||||
/// <param name="zeroBasedEnumClass"></param>
|
||||
/// <param name="jsonSerializerOptions"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, ZeroBasedEnumClass zeroBasedEnumClass, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
|
||||
var zeroBasedEnumRawValue = ZeroBasedEnumClass.ZeroBasedEnumEnumToJsonValue(zeroBasedEnumClass.ZeroBasedEnum);
|
||||
if (zeroBasedEnumRawValue != null)
|
||||
writer.WriteString("ZeroBasedEnum", zeroBasedEnumRawValue);
|
||||
else
|
||||
writer.WriteNull("ZeroBasedEnum");
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
@ -96,6 +96,7 @@ docs/models/User.md
|
||||
docs/models/Whale.md
|
||||
docs/models/Zebra.md
|
||||
docs/models/ZeroBasedEnum.md
|
||||
docs/models/ZeroBasedEnumClass.md
|
||||
docs/scripts/git_push.ps1
|
||||
docs/scripts/git_push.sh
|
||||
src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs
|
||||
@ -218,5 +219,6 @@ src/Org.OpenAPITools/Model/User.cs
|
||||
src/Org.OpenAPITools/Model/Whale.cs
|
||||
src/Org.OpenAPITools/Model/Zebra.cs
|
||||
src/Org.OpenAPITools/Model/ZeroBasedEnum.cs
|
||||
src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs
|
||||
src/Org.OpenAPITools/Org.OpenAPITools.csproj
|
||||
src/Org.OpenAPITools/README.md
|
||||
|
@ -2211,6 +2211,14 @@ components:
|
||||
- unknown
|
||||
- notUnknown
|
||||
type: string
|
||||
ZeroBasedEnumClass:
|
||||
properties:
|
||||
ZeroBasedEnum:
|
||||
enum:
|
||||
- unknown
|
||||
- notUnknown
|
||||
type: string
|
||||
type: object
|
||||
_foo_get_default_response:
|
||||
example:
|
||||
string:
|
||||
|
@ -0,0 +1,10 @@
|
||||
# Org.OpenAPITools.Model.ZeroBasedEnumClass
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ZeroBasedEnum** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
@ -0,0 +1,68 @@
|
||||
/*
|
||||
* 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 Xunit;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Org.OpenAPITools.Model;
|
||||
using Org.OpenAPITools.Client;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing ZeroBasedEnumClass
|
||||
/// </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 ZeroBasedEnumClassTests : IDisposable
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for ZeroBasedEnumClass
|
||||
//private ZeroBasedEnumClass instance;
|
||||
|
||||
public ZeroBasedEnumClassTests()
|
||||
{
|
||||
// TODO uncomment below to create an instance of ZeroBasedEnumClass
|
||||
//instance = new ZeroBasedEnumClass();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of ZeroBasedEnumClass
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ZeroBasedEnumClassInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsType" ZeroBasedEnumClass
|
||||
//Assert.IsType<ZeroBasedEnumClass>(instance);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ZeroBasedEnum'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ZeroBasedEnumTest()
|
||||
{
|
||||
// TODO unit test for the property 'ZeroBasedEnum'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -164,6 +164,8 @@ namespace Org.OpenAPITools.Client
|
||||
return Zebra.TypeEnumToJsonValue(zebraTypeEnum);
|
||||
if (obj is ZeroBasedEnum zeroBasedEnum)
|
||||
return ZeroBasedEnumConverter.ToJsonValue(zeroBasedEnum);
|
||||
if (obj is ZeroBasedEnumClass.ZeroBasedEnumEnum zeroBasedEnumClassZeroBasedEnumEnum)
|
||||
return ZeroBasedEnumClass.ZeroBasedEnumEnumToJsonValue(zeroBasedEnumClassZeroBasedEnumEnum);
|
||||
if (obj is ICollection collection)
|
||||
{
|
||||
List<string> entries = new List<string>();
|
||||
|
@ -137,6 +137,7 @@ namespace Org.OpenAPITools.Client
|
||||
_jsonOptions.Converters.Add(new ZebraJsonConverter());
|
||||
_jsonOptions.Converters.Add(new ZeroBasedEnumConverter());
|
||||
_jsonOptions.Converters.Add(new ZeroBasedEnumNullableConverter());
|
||||
_jsonOptions.Converters.Add(new ZeroBasedEnumClassJsonConverter());
|
||||
_services.AddSingleton(new JsonSerializerOptionsProvider(_jsonOptions));
|
||||
_services.AddSingleton<IApiFactory, ApiFactory>();
|
||||
_services.AddTransient<TAnotherFakeApi, TAnotherFakeApi>();
|
||||
|
@ -0,0 +1,212 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* 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.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// ZeroBasedEnumClass
|
||||
/// </summary>
|
||||
public partial class ZeroBasedEnumClass : IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ZeroBasedEnumClass" /> class.
|
||||
/// </summary>
|
||||
/// <param name="zeroBasedEnum">zeroBasedEnum</param>
|
||||
[JsonConstructor]
|
||||
public ZeroBasedEnumClass(ZeroBasedEnumEnum zeroBasedEnum)
|
||||
{
|
||||
ZeroBasedEnum = zeroBasedEnum;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Defines ZeroBasedEnum
|
||||
/// </summary>
|
||||
public enum ZeroBasedEnumEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum Unknown for value: unknown
|
||||
/// </summary>
|
||||
Unknown,
|
||||
|
||||
/// <summary>
|
||||
/// Enum NotUnknown for value: notUnknown
|
||||
/// </summary>
|
||||
NotUnknown
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a ZeroBasedEnumEnum
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static ZeroBasedEnumEnum ZeroBasedEnumEnumFromString(string value)
|
||||
{
|
||||
if (value == "unknown")
|
||||
return ZeroBasedEnumEnum.Unknown;
|
||||
|
||||
if (value == "notUnknown")
|
||||
return ZeroBasedEnumEnum.NotUnknown;
|
||||
|
||||
throw new NotImplementedException($"Could not convert value to type ZeroBasedEnumEnum: '{value}'");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns equivalent json value
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public static string ZeroBasedEnumEnumToJsonValue(ZeroBasedEnumEnum value)
|
||||
{
|
||||
if (value == ZeroBasedEnumEnum.Unknown)
|
||||
return "unknown";
|
||||
|
||||
if (value == ZeroBasedEnumEnum.NotUnknown)
|
||||
return "notUnknown";
|
||||
|
||||
throw new NotImplementedException($"Value could not be handled: '{value}'");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ZeroBasedEnum
|
||||
/// </summary>
|
||||
[JsonPropertyName("ZeroBasedEnum")]
|
||||
public ZeroBasedEnumEnum ZeroBasedEnum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <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 ZeroBasedEnumClass {\n");
|
||||
sb.Append(" ZeroBasedEnum: ").Append(ZeroBasedEnum).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A Json converter for type ZeroBasedEnumClass
|
||||
/// </summary>
|
||||
public class ZeroBasedEnumClassJsonConverter : JsonConverter<ZeroBasedEnumClass>
|
||||
{
|
||||
/// <summary>
|
||||
/// A Json reader.
|
||||
/// </summary>
|
||||
/// <param name="utf8JsonReader"></param>
|
||||
/// <param name="typeToConvert"></param>
|
||||
/// <param name="jsonSerializerOptions"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="JsonException"></exception>
|
||||
public override ZeroBasedEnumClass Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
int currentDepth = utf8JsonReader.CurrentDepth;
|
||||
|
||||
if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray)
|
||||
throw new JsonException();
|
||||
|
||||
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
|
||||
|
||||
ZeroBasedEnumClass.ZeroBasedEnumEnum zeroBasedEnum = default;
|
||||
|
||||
while (utf8JsonReader.Read())
|
||||
{
|
||||
if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth)
|
||||
break;
|
||||
|
||||
if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth)
|
||||
break;
|
||||
|
||||
if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1)
|
||||
{
|
||||
string propertyName = utf8JsonReader.GetString();
|
||||
utf8JsonReader.Read();
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
case "ZeroBasedEnum":
|
||||
string zeroBasedEnumRawValue = utf8JsonReader.GetString();
|
||||
zeroBasedEnum = ZeroBasedEnumClass.ZeroBasedEnumEnumFromString(zeroBasedEnumRawValue);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
|
||||
if (zeroBasedEnum == null)
|
||||
throw new ArgumentNullException(nameof(zeroBasedEnum), "Property is required for class ZeroBasedEnumClass.");
|
||||
|
||||
#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
|
||||
return new ZeroBasedEnumClass(zeroBasedEnum);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A Json writer
|
||||
/// </summary>
|
||||
/// <param name="writer"></param>
|
||||
/// <param name="zeroBasedEnumClass"></param>
|
||||
/// <param name="jsonSerializerOptions"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, ZeroBasedEnumClass zeroBasedEnumClass, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
|
||||
var zeroBasedEnumRawValue = ZeroBasedEnumClass.ZeroBasedEnumEnumToJsonValue(zeroBasedEnumClass.ZeroBasedEnum);
|
||||
if (zeroBasedEnumRawValue != null)
|
||||
writer.WriteString("ZeroBasedEnum", zeroBasedEnumRawValue);
|
||||
else
|
||||
writer.WriteNull("ZeroBasedEnum");
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
@ -96,6 +96,7 @@ docs/UserApi.md
|
||||
docs/Whale.md
|
||||
docs/Zebra.md
|
||||
docs/ZeroBasedEnum.md
|
||||
docs/ZeroBasedEnumClass.md
|
||||
git_push.sh
|
||||
src/Org.OpenAPITools/Api/AnotherFakeApi.cs
|
||||
src/Org.OpenAPITools/Api/DefaultApi.cs
|
||||
@ -209,4 +210,5 @@ src/Org.OpenAPITools/Model/User.cs
|
||||
src/Org.OpenAPITools/Model/Whale.cs
|
||||
src/Org.OpenAPITools/Model/Zebra.cs
|
||||
src/Org.OpenAPITools/Model/ZeroBasedEnum.cs
|
||||
src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs
|
||||
src/Org.OpenAPITools/Org.OpenAPITools.csproj
|
||||
|
@ -260,6 +260,7 @@ Class | Method | HTTP request | Description
|
||||
- [Model.Whale](docs/Whale.md)
|
||||
- [Model.Zebra](docs/Zebra.md)
|
||||
- [Model.ZeroBasedEnum](docs/ZeroBasedEnum.md)
|
||||
- [Model.ZeroBasedEnumClass](docs/ZeroBasedEnumClass.md)
|
||||
|
||||
|
||||
<a id="documentation-for-authorization"></a>
|
||||
|
@ -2211,6 +2211,14 @@ components:
|
||||
- unknown
|
||||
- notUnknown
|
||||
type: string
|
||||
ZeroBasedEnumClass:
|
||||
properties:
|
||||
ZeroBasedEnum:
|
||||
enum:
|
||||
- unknown
|
||||
- notUnknown
|
||||
type: string
|
||||
type: object
|
||||
_foo_get_default_response:
|
||||
example:
|
||||
string:
|
||||
|
@ -0,0 +1,10 @@
|
||||
# Org.OpenAPITools.Model.ZeroBasedEnumClass
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ZeroBasedEnum** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
@ -0,0 +1,69 @@
|
||||
/*
|
||||
* 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 Xunit;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Org.OpenAPITools.Model;
|
||||
using Org.OpenAPITools.Client;
|
||||
using System.Reflection;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing ZeroBasedEnumClass
|
||||
/// </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 ZeroBasedEnumClassTests : IDisposable
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for ZeroBasedEnumClass
|
||||
//private ZeroBasedEnumClass instance;
|
||||
|
||||
public ZeroBasedEnumClassTests()
|
||||
{
|
||||
// TODO uncomment below to create an instance of ZeroBasedEnumClass
|
||||
//instance = new ZeroBasedEnumClass();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of ZeroBasedEnumClass
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ZeroBasedEnumClassInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsType" ZeroBasedEnumClass
|
||||
//Assert.IsType<ZeroBasedEnumClass>(instance);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ZeroBasedEnum'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ZeroBasedEnumTest()
|
||||
{
|
||||
// TODO unit test for the property 'ZeroBasedEnum'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,150 @@
|
||||
/*
|
||||
* 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 System.ComponentModel.DataAnnotations;
|
||||
using FileParameter = Org.OpenAPITools.Client.FileParameter;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// ZeroBasedEnumClass
|
||||
/// </summary>
|
||||
[DataContract(Name = "ZeroBasedEnumClass")]
|
||||
public partial class ZeroBasedEnumClass : IEquatable<ZeroBasedEnumClass>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines ZeroBasedEnum
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum ZeroBasedEnumEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum Unknown for value: unknown
|
||||
/// </summary>
|
||||
[EnumMember(Value = "unknown")]
|
||||
Unknown,
|
||||
|
||||
/// <summary>
|
||||
/// Enum NotUnknown for value: notUnknown
|
||||
/// </summary>
|
||||
[EnumMember(Value = "notUnknown")]
|
||||
NotUnknown
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ZeroBasedEnum
|
||||
/// </summary>
|
||||
[DataMember(Name = "ZeroBasedEnum", EmitDefaultValue = false)]
|
||||
public ZeroBasedEnumEnum? ZeroBasedEnum { get; set; }
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ZeroBasedEnumClass" /> class.
|
||||
/// </summary>
|
||||
/// <param name="zeroBasedEnum">zeroBasedEnum.</param>
|
||||
public ZeroBasedEnumClass(ZeroBasedEnumEnum? zeroBasedEnum = default(ZeroBasedEnumEnum?))
|
||||
{
|
||||
this.ZeroBasedEnum = zeroBasedEnum;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { 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 ZeroBasedEnumClass {\n");
|
||||
sb.Append(" ZeroBasedEnum: ").Append(ZeroBasedEnum).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).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 OpenAPIClientUtils.compareLogic.Compare(this, input as ZeroBasedEnumClass).AreEqual;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if ZeroBasedEnumClass instances are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of ZeroBasedEnumClass to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(ZeroBasedEnumClass input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
/// <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.ZeroBasedEnum.GetHashCode();
|
||||
if (this.AdditionalProperties != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -96,6 +96,7 @@ docs/UserApi.md
|
||||
docs/Whale.md
|
||||
docs/Zebra.md
|
||||
docs/ZeroBasedEnum.md
|
||||
docs/ZeroBasedEnumClass.md
|
||||
git_push.sh
|
||||
src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj
|
||||
src/Org.OpenAPITools/Api/AnotherFakeApi.cs
|
||||
@ -212,4 +213,5 @@ src/Org.OpenAPITools/Model/User.cs
|
||||
src/Org.OpenAPITools/Model/Whale.cs
|
||||
src/Org.OpenAPITools/Model/Zebra.cs
|
||||
src/Org.OpenAPITools/Model/ZeroBasedEnum.cs
|
||||
src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs
|
||||
src/Org.OpenAPITools/Org.OpenAPITools.csproj
|
||||
|
@ -247,6 +247,7 @@ Class | Method | HTTP request | Description
|
||||
- [Model.Whale](docs/Whale.md)
|
||||
- [Model.Zebra](docs/Zebra.md)
|
||||
- [Model.ZeroBasedEnum](docs/ZeroBasedEnum.md)
|
||||
- [Model.ZeroBasedEnumClass](docs/ZeroBasedEnumClass.md)
|
||||
|
||||
|
||||
<a id="documentation-for-authorization"></a>
|
||||
|
@ -2211,6 +2211,14 @@ components:
|
||||
- unknown
|
||||
- notUnknown
|
||||
type: string
|
||||
ZeroBasedEnumClass:
|
||||
properties:
|
||||
ZeroBasedEnum:
|
||||
enum:
|
||||
- unknown
|
||||
- notUnknown
|
||||
type: string
|
||||
type: object
|
||||
_foo_get_default_response:
|
||||
example:
|
||||
string:
|
||||
|
@ -0,0 +1,10 @@
|
||||
# Org.OpenAPITools.Model.ZeroBasedEnumClass
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ZeroBasedEnum** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
@ -0,0 +1,69 @@
|
||||
/*
|
||||
* 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 Xunit;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Org.OpenAPITools.Model;
|
||||
using Org.OpenAPITools.Client;
|
||||
using System.Reflection;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing ZeroBasedEnumClass
|
||||
/// </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 ZeroBasedEnumClassTests : IDisposable
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for ZeroBasedEnumClass
|
||||
//private ZeroBasedEnumClass instance;
|
||||
|
||||
public ZeroBasedEnumClassTests()
|
||||
{
|
||||
// TODO uncomment below to create an instance of ZeroBasedEnumClass
|
||||
//instance = new ZeroBasedEnumClass();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of ZeroBasedEnumClass
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ZeroBasedEnumClassInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsType" ZeroBasedEnumClass
|
||||
//Assert.IsType<ZeroBasedEnumClass>(instance);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ZeroBasedEnum'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ZeroBasedEnumTest()
|
||||
{
|
||||
// TODO unit test for the property 'ZeroBasedEnum'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,149 @@
|
||||
/*
|
||||
* 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 System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// ZeroBasedEnumClass
|
||||
/// </summary>
|
||||
[DataContract(Name = "ZeroBasedEnumClass")]
|
||||
public partial class ZeroBasedEnumClass : IEquatable<ZeroBasedEnumClass>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines ZeroBasedEnum
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum ZeroBasedEnumEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum Unknown for value: unknown
|
||||
/// </summary>
|
||||
[EnumMember(Value = "unknown")]
|
||||
Unknown,
|
||||
|
||||
/// <summary>
|
||||
/// Enum NotUnknown for value: notUnknown
|
||||
/// </summary>
|
||||
[EnumMember(Value = "notUnknown")]
|
||||
NotUnknown
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ZeroBasedEnum
|
||||
/// </summary>
|
||||
[DataMember(Name = "ZeroBasedEnum", EmitDefaultValue = false)]
|
||||
public ZeroBasedEnumEnum? ZeroBasedEnum { get; set; }
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ZeroBasedEnumClass" /> class.
|
||||
/// </summary>
|
||||
/// <param name="zeroBasedEnum">zeroBasedEnum.</param>
|
||||
public ZeroBasedEnumClass(ZeroBasedEnumEnum? zeroBasedEnum = default(ZeroBasedEnumEnum?))
|
||||
{
|
||||
this.ZeroBasedEnum = zeroBasedEnum;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { 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 ZeroBasedEnumClass {\n");
|
||||
sb.Append(" ZeroBasedEnum: ").Append(ZeroBasedEnum).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).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 OpenAPIClientUtils.compareLogic.Compare(this, input as ZeroBasedEnumClass).AreEqual;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if ZeroBasedEnumClass instances are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of ZeroBasedEnumClass to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(ZeroBasedEnumClass input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
/// <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.ZeroBasedEnum.GetHashCode();
|
||||
if (this.AdditionalProperties != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -96,6 +96,7 @@ docs/UserApi.md
|
||||
docs/Whale.md
|
||||
docs/Zebra.md
|
||||
docs/ZeroBasedEnum.md
|
||||
docs/ZeroBasedEnumClass.md
|
||||
git_push.sh
|
||||
src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj
|
||||
src/Org.OpenAPITools/Api/AnotherFakeApi.cs
|
||||
@ -212,4 +213,5 @@ src/Org.OpenAPITools/Model/User.cs
|
||||
src/Org.OpenAPITools/Model/Whale.cs
|
||||
src/Org.OpenAPITools/Model/Zebra.cs
|
||||
src/Org.OpenAPITools/Model/ZeroBasedEnum.cs
|
||||
src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs
|
||||
src/Org.OpenAPITools/Org.OpenAPITools.csproj
|
||||
|
@ -247,6 +247,7 @@ Class | Method | HTTP request | Description
|
||||
- [Model.Whale](docs/Whale.md)
|
||||
- [Model.Zebra](docs/Zebra.md)
|
||||
- [Model.ZeroBasedEnum](docs/ZeroBasedEnum.md)
|
||||
- [Model.ZeroBasedEnumClass](docs/ZeroBasedEnumClass.md)
|
||||
|
||||
|
||||
<a id="documentation-for-authorization"></a>
|
||||
|
@ -2211,6 +2211,14 @@ components:
|
||||
- unknown
|
||||
- notUnknown
|
||||
type: string
|
||||
ZeroBasedEnumClass:
|
||||
properties:
|
||||
ZeroBasedEnum:
|
||||
enum:
|
||||
- unknown
|
||||
- notUnknown
|
||||
type: string
|
||||
type: object
|
||||
_foo_get_default_response:
|
||||
example:
|
||||
string:
|
||||
|
@ -0,0 +1,10 @@
|
||||
# Org.OpenAPITools.Model.ZeroBasedEnumClass
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ZeroBasedEnum** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
@ -0,0 +1,69 @@
|
||||
/*
|
||||
* 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 Xunit;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Org.OpenAPITools.Model;
|
||||
using Org.OpenAPITools.Client;
|
||||
using System.Reflection;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing ZeroBasedEnumClass
|
||||
/// </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 ZeroBasedEnumClassTests : IDisposable
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for ZeroBasedEnumClass
|
||||
//private ZeroBasedEnumClass instance;
|
||||
|
||||
public ZeroBasedEnumClassTests()
|
||||
{
|
||||
// TODO uncomment below to create an instance of ZeroBasedEnumClass
|
||||
//instance = new ZeroBasedEnumClass();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of ZeroBasedEnumClass
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ZeroBasedEnumClassInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsType" ZeroBasedEnumClass
|
||||
//Assert.IsType<ZeroBasedEnumClass>(instance);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ZeroBasedEnum'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ZeroBasedEnumTest()
|
||||
{
|
||||
// TODO unit test for the property 'ZeroBasedEnum'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,149 @@
|
||||
/*
|
||||
* 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 System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// ZeroBasedEnumClass
|
||||
/// </summary>
|
||||
[DataContract(Name = "ZeroBasedEnumClass")]
|
||||
public partial class ZeroBasedEnumClass : IEquatable<ZeroBasedEnumClass>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines ZeroBasedEnum
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum ZeroBasedEnumEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum Unknown for value: unknown
|
||||
/// </summary>
|
||||
[EnumMember(Value = "unknown")]
|
||||
Unknown,
|
||||
|
||||
/// <summary>
|
||||
/// Enum NotUnknown for value: notUnknown
|
||||
/// </summary>
|
||||
[EnumMember(Value = "notUnknown")]
|
||||
NotUnknown
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ZeroBasedEnum
|
||||
/// </summary>
|
||||
[DataMember(Name = "ZeroBasedEnum", EmitDefaultValue = false)]
|
||||
public ZeroBasedEnumEnum? ZeroBasedEnum { get; set; }
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ZeroBasedEnumClass" /> class.
|
||||
/// </summary>
|
||||
/// <param name="zeroBasedEnum">zeroBasedEnum.</param>
|
||||
public ZeroBasedEnumClass(ZeroBasedEnumEnum? zeroBasedEnum = default(ZeroBasedEnumEnum?))
|
||||
{
|
||||
this.ZeroBasedEnum = zeroBasedEnum;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { 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 ZeroBasedEnumClass {\n");
|
||||
sb.Append(" ZeroBasedEnum: ").Append(ZeroBasedEnum).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).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 OpenAPIClientUtils.compareLogic.Compare(this, input as ZeroBasedEnumClass).AreEqual;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if ZeroBasedEnumClass instances are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of ZeroBasedEnumClass to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(ZeroBasedEnumClass input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
/// <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.ZeroBasedEnum.GetHashCode();
|
||||
if (this.AdditionalProperties != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -96,6 +96,7 @@ docs/UserApi.md
|
||||
docs/Whale.md
|
||||
docs/Zebra.md
|
||||
docs/ZeroBasedEnum.md
|
||||
docs/ZeroBasedEnumClass.md
|
||||
git_push.sh
|
||||
src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj
|
||||
src/Org.OpenAPITools/Api/AnotherFakeApi.cs
|
||||
@ -212,4 +213,5 @@ src/Org.OpenAPITools/Model/User.cs
|
||||
src/Org.OpenAPITools/Model/Whale.cs
|
||||
src/Org.OpenAPITools/Model/Zebra.cs
|
||||
src/Org.OpenAPITools/Model/ZeroBasedEnum.cs
|
||||
src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs
|
||||
src/Org.OpenAPITools/Org.OpenAPITools.csproj
|
||||
|
@ -247,6 +247,7 @@ Class | Method | HTTP request | Description
|
||||
- [Model.Whale](docs/Whale.md)
|
||||
- [Model.Zebra](docs/Zebra.md)
|
||||
- [Model.ZeroBasedEnum](docs/ZeroBasedEnum.md)
|
||||
- [Model.ZeroBasedEnumClass](docs/ZeroBasedEnumClass.md)
|
||||
|
||||
|
||||
<a id="documentation-for-authorization"></a>
|
||||
|
@ -2211,6 +2211,14 @@ components:
|
||||
- unknown
|
||||
- notUnknown
|
||||
type: string
|
||||
ZeroBasedEnumClass:
|
||||
properties:
|
||||
ZeroBasedEnum:
|
||||
enum:
|
||||
- unknown
|
||||
- notUnknown
|
||||
type: string
|
||||
type: object
|
||||
_foo_get_default_response:
|
||||
example:
|
||||
string:
|
||||
|
@ -0,0 +1,10 @@
|
||||
# Org.OpenAPITools.Model.ZeroBasedEnumClass
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ZeroBasedEnum** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
@ -0,0 +1,69 @@
|
||||
/*
|
||||
* 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 Xunit;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Org.OpenAPITools.Model;
|
||||
using Org.OpenAPITools.Client;
|
||||
using System.Reflection;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing ZeroBasedEnumClass
|
||||
/// </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 ZeroBasedEnumClassTests : IDisposable
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for ZeroBasedEnumClass
|
||||
//private ZeroBasedEnumClass instance;
|
||||
|
||||
public ZeroBasedEnumClassTests()
|
||||
{
|
||||
// TODO uncomment below to create an instance of ZeroBasedEnumClass
|
||||
//instance = new ZeroBasedEnumClass();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of ZeroBasedEnumClass
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ZeroBasedEnumClassInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsType" ZeroBasedEnumClass
|
||||
//Assert.IsType<ZeroBasedEnumClass>(instance);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ZeroBasedEnum'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ZeroBasedEnumTest()
|
||||
{
|
||||
// TODO unit test for the property 'ZeroBasedEnum'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,149 @@
|
||||
/*
|
||||
* 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 System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// ZeroBasedEnumClass
|
||||
/// </summary>
|
||||
[DataContract(Name = "ZeroBasedEnumClass")]
|
||||
public partial class ZeroBasedEnumClass : IEquatable<ZeroBasedEnumClass>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines ZeroBasedEnum
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum ZeroBasedEnumEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum Unknown for value: unknown
|
||||
/// </summary>
|
||||
[EnumMember(Value = "unknown")]
|
||||
Unknown,
|
||||
|
||||
/// <summary>
|
||||
/// Enum NotUnknown for value: notUnknown
|
||||
/// </summary>
|
||||
[EnumMember(Value = "notUnknown")]
|
||||
NotUnknown
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ZeroBasedEnum
|
||||
/// </summary>
|
||||
[DataMember(Name = "ZeroBasedEnum", EmitDefaultValue = false)]
|
||||
public ZeroBasedEnumEnum? ZeroBasedEnum { get; set; }
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ZeroBasedEnumClass" /> class.
|
||||
/// </summary>
|
||||
/// <param name="zeroBasedEnum">zeroBasedEnum.</param>
|
||||
public ZeroBasedEnumClass(ZeroBasedEnumEnum? zeroBasedEnum = default(ZeroBasedEnumEnum?))
|
||||
{
|
||||
this.ZeroBasedEnum = zeroBasedEnum;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { 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 ZeroBasedEnumClass {\n");
|
||||
sb.Append(" ZeroBasedEnum: ").Append(ZeroBasedEnum).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).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 OpenAPIClientUtils.compareLogic.Compare(this, input as ZeroBasedEnumClass).AreEqual;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if ZeroBasedEnumClass instances are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of ZeroBasedEnumClass to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(ZeroBasedEnumClass input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
/// <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.ZeroBasedEnum.GetHashCode();
|
||||
if (this.AdditionalProperties != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -94,6 +94,7 @@ docs/UserApi.md
|
||||
docs/Whale.md
|
||||
docs/Zebra.md
|
||||
docs/ZeroBasedEnum.md
|
||||
docs/ZeroBasedEnumClass.md
|
||||
git_push.sh
|
||||
src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.asmdef
|
||||
src/Org.OpenAPITools/Api/AnotherFakeApi.cs
|
||||
@ -208,4 +209,5 @@ src/Org.OpenAPITools/Model/User.cs
|
||||
src/Org.OpenAPITools/Model/Whale.cs
|
||||
src/Org.OpenAPITools/Model/Zebra.cs
|
||||
src/Org.OpenAPITools/Model/ZeroBasedEnum.cs
|
||||
src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs
|
||||
src/Org.OpenAPITools/Org.OpenAPITools.asmdef
|
||||
|
@ -221,6 +221,7 @@ Class | Method | HTTP request | Description
|
||||
- [Model.Whale](Whale.md)
|
||||
- [Model.Zebra](Zebra.md)
|
||||
- [Model.ZeroBasedEnum](ZeroBasedEnum.md)
|
||||
- [Model.ZeroBasedEnumClass](ZeroBasedEnumClass.md)
|
||||
|
||||
|
||||
<a id="documentation-for-authorization"></a>
|
||||
|
@ -2211,6 +2211,14 @@ components:
|
||||
- unknown
|
||||
- notUnknown
|
||||
type: string
|
||||
ZeroBasedEnumClass:
|
||||
properties:
|
||||
ZeroBasedEnum:
|
||||
enum:
|
||||
- unknown
|
||||
- notUnknown
|
||||
type: string
|
||||
type: object
|
||||
_foo_get_default_response:
|
||||
example:
|
||||
string:
|
||||
|
@ -0,0 +1,10 @@
|
||||
# Org.OpenAPITools.Model.ZeroBasedEnumClass
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ZeroBasedEnum** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
@ -0,0 +1,66 @@
|
||||
/*
|
||||
* 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 ZeroBasedEnumClass
|
||||
/// </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 ZeroBasedEnumClassTests : IDisposable
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for ZeroBasedEnumClass
|
||||
//private ZeroBasedEnumClass instance;
|
||||
|
||||
public ZeroBasedEnumClassTests()
|
||||
{
|
||||
// TODO uncomment below to create an instance of ZeroBasedEnumClass
|
||||
//instance = new ZeroBasedEnumClass();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of ZeroBasedEnumClass
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void ZeroBasedEnumClassInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsType" ZeroBasedEnumClass
|
||||
//Assert.IsType<ZeroBasedEnumClass>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ZeroBasedEnum'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void ZeroBasedEnumTest()
|
||||
{
|
||||
// TODO unit test for the property 'ZeroBasedEnum'
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,134 @@
|
||||
/*
|
||||
* 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>
|
||||
/// ZeroBasedEnumClass
|
||||
/// </summary>
|
||||
[DataContract(Name = "ZeroBasedEnumClass")]
|
||||
public partial class ZeroBasedEnumClass : IEquatable<ZeroBasedEnumClass>
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines ZeroBasedEnum
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum ZeroBasedEnumEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum Unknown for value: unknown
|
||||
/// </summary>
|
||||
[EnumMember(Value = "unknown")]
|
||||
Unknown,
|
||||
|
||||
/// <summary>
|
||||
/// Enum NotUnknown for value: notUnknown
|
||||
/// </summary>
|
||||
[EnumMember(Value = "notUnknown")]
|
||||
NotUnknown
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ZeroBasedEnum
|
||||
/// </summary>
|
||||
[DataMember(Name = "ZeroBasedEnum", EmitDefaultValue = false)]
|
||||
public ZeroBasedEnumEnum? ZeroBasedEnum { get; set; }
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ZeroBasedEnumClass" /> class.
|
||||
/// </summary>
|
||||
/// <param name="zeroBasedEnum">zeroBasedEnum.</param>
|
||||
public ZeroBasedEnumClass(ZeroBasedEnumEnum? zeroBasedEnum = default(ZeroBasedEnumEnum?))
|
||||
{
|
||||
this.ZeroBasedEnum = zeroBasedEnum;
|
||||
}
|
||||
|
||||
/// <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 ZeroBasedEnumClass {\n");
|
||||
sb.Append(" ZeroBasedEnum: ").Append(ZeroBasedEnum).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 ZeroBasedEnumClass);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if ZeroBasedEnumClass instances are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of ZeroBasedEnumClass to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(ZeroBasedEnumClass input)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return
|
||||
(
|
||||
this.ZeroBasedEnum == input.ZeroBasedEnum ||
|
||||
this.ZeroBasedEnum.Equals(input.ZeroBasedEnum)
|
||||
);
|
||||
}
|
||||
|
||||
/// <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.ZeroBasedEnum.GetHashCode();
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -96,6 +96,7 @@ docs/UserApi.md
|
||||
docs/Whale.md
|
||||
docs/Zebra.md
|
||||
docs/ZeroBasedEnum.md
|
||||
docs/ZeroBasedEnumClass.md
|
||||
git_push.sh
|
||||
src/Org.OpenAPITools/Api/AnotherFakeApi.cs
|
||||
src/Org.OpenAPITools/Api/DefaultApi.cs
|
||||
@ -211,4 +212,5 @@ src/Org.OpenAPITools/Model/User.cs
|
||||
src/Org.OpenAPITools/Model/Whale.cs
|
||||
src/Org.OpenAPITools/Model/Zebra.cs
|
||||
src/Org.OpenAPITools/Model/ZeroBasedEnum.cs
|
||||
src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs
|
||||
src/Org.OpenAPITools/Org.OpenAPITools.csproj
|
||||
|
@ -235,6 +235,7 @@ Class | Method | HTTP request | Description
|
||||
- [Model.Whale](docs/Whale.md)
|
||||
- [Model.Zebra](docs/Zebra.md)
|
||||
- [Model.ZeroBasedEnum](docs/ZeroBasedEnum.md)
|
||||
- [Model.ZeroBasedEnumClass](docs/ZeroBasedEnumClass.md)
|
||||
|
||||
|
||||
<a id="documentation-for-authorization"></a>
|
||||
|
@ -2211,6 +2211,14 @@ components:
|
||||
- unknown
|
||||
- notUnknown
|
||||
type: string
|
||||
ZeroBasedEnumClass:
|
||||
properties:
|
||||
ZeroBasedEnum:
|
||||
enum:
|
||||
- unknown
|
||||
- notUnknown
|
||||
type: string
|
||||
type: object
|
||||
_foo_get_default_response:
|
||||
example:
|
||||
string:
|
||||
|
@ -0,0 +1,10 @@
|
||||
# Org.OpenAPITools.Model.ZeroBasedEnumClass
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ZeroBasedEnum** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
@ -0,0 +1,69 @@
|
||||
/*
|
||||
* 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 Xunit;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Org.OpenAPITools.Model;
|
||||
using Org.OpenAPITools.Client;
|
||||
using System.Reflection;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing ZeroBasedEnumClass
|
||||
/// </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 ZeroBasedEnumClassTests : IDisposable
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for ZeroBasedEnumClass
|
||||
//private ZeroBasedEnumClass instance;
|
||||
|
||||
public ZeroBasedEnumClassTests()
|
||||
{
|
||||
// TODO uncomment below to create an instance of ZeroBasedEnumClass
|
||||
//instance = new ZeroBasedEnumClass();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of ZeroBasedEnumClass
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ZeroBasedEnumClassInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsType" ZeroBasedEnumClass
|
||||
//Assert.IsType<ZeroBasedEnumClass>(instance);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ZeroBasedEnum'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ZeroBasedEnumTest()
|
||||
{
|
||||
// TODO unit test for the property 'ZeroBasedEnum'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,149 @@
|
||||
/*
|
||||
* 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 System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// ZeroBasedEnumClass
|
||||
/// </summary>
|
||||
[DataContract(Name = "ZeroBasedEnumClass")]
|
||||
public partial class ZeroBasedEnumClass : IEquatable<ZeroBasedEnumClass>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines ZeroBasedEnum
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum ZeroBasedEnumEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum Unknown for value: unknown
|
||||
/// </summary>
|
||||
[EnumMember(Value = "unknown")]
|
||||
Unknown,
|
||||
|
||||
/// <summary>
|
||||
/// Enum NotUnknown for value: notUnknown
|
||||
/// </summary>
|
||||
[EnumMember(Value = "notUnknown")]
|
||||
NotUnknown
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ZeroBasedEnum
|
||||
/// </summary>
|
||||
[DataMember(Name = "ZeroBasedEnum", EmitDefaultValue = false)]
|
||||
public ZeroBasedEnumEnum? ZeroBasedEnum { get; set; }
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ZeroBasedEnumClass" /> class.
|
||||
/// </summary>
|
||||
/// <param name="zeroBasedEnum">zeroBasedEnum.</param>
|
||||
public ZeroBasedEnumClass(ZeroBasedEnumEnum? zeroBasedEnum = default(ZeroBasedEnumEnum?))
|
||||
{
|
||||
this.ZeroBasedEnum = zeroBasedEnum;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { 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 ZeroBasedEnumClass {\n");
|
||||
sb.Append(" ZeroBasedEnum: ").Append(ZeroBasedEnum).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).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 OpenAPIClientUtils.compareLogic.Compare(this, input as ZeroBasedEnumClass).AreEqual;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if ZeroBasedEnumClass instances are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of ZeroBasedEnumClass to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(ZeroBasedEnumClass input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
/// <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.ZeroBasedEnum.GetHashCode();
|
||||
if (this.AdditionalProperties != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -96,6 +96,7 @@ docs/UserApi.md
|
||||
docs/Whale.md
|
||||
docs/Zebra.md
|
||||
docs/ZeroBasedEnum.md
|
||||
docs/ZeroBasedEnumClass.md
|
||||
git_push.sh
|
||||
src/Org.OpenAPITools/Api/AnotherFakeApi.cs
|
||||
src/Org.OpenAPITools/Api/DefaultApi.cs
|
||||
@ -211,4 +212,5 @@ src/Org.OpenAPITools/Model/User.cs
|
||||
src/Org.OpenAPITools/Model/Whale.cs
|
||||
src/Org.OpenAPITools/Model/Zebra.cs
|
||||
src/Org.OpenAPITools/Model/ZeroBasedEnum.cs
|
||||
src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs
|
||||
src/Org.OpenAPITools/Org.OpenAPITools.csproj
|
||||
|
@ -247,6 +247,7 @@ Class | Method | HTTP request | Description
|
||||
- [Model.Whale](docs/Whale.md)
|
||||
- [Model.Zebra](docs/Zebra.md)
|
||||
- [Model.ZeroBasedEnum](docs/ZeroBasedEnum.md)
|
||||
- [Model.ZeroBasedEnumClass](docs/ZeroBasedEnumClass.md)
|
||||
|
||||
|
||||
<a id="documentation-for-authorization"></a>
|
||||
|
@ -2211,6 +2211,14 @@ components:
|
||||
- unknown
|
||||
- notUnknown
|
||||
type: string
|
||||
ZeroBasedEnumClass:
|
||||
properties:
|
||||
ZeroBasedEnum:
|
||||
enum:
|
||||
- unknown
|
||||
- notUnknown
|
||||
type: string
|
||||
type: object
|
||||
_foo_get_default_response:
|
||||
example:
|
||||
string:
|
||||
|
@ -0,0 +1,10 @@
|
||||
# Org.OpenAPITools.Model.ZeroBasedEnumClass
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ZeroBasedEnum** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
@ -0,0 +1,69 @@
|
||||
/*
|
||||
* 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 Xunit;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Org.OpenAPITools.Model;
|
||||
using Org.OpenAPITools.Client;
|
||||
using System.Reflection;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing ZeroBasedEnumClass
|
||||
/// </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 ZeroBasedEnumClassTests : IDisposable
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for ZeroBasedEnumClass
|
||||
//private ZeroBasedEnumClass instance;
|
||||
|
||||
public ZeroBasedEnumClassTests()
|
||||
{
|
||||
// TODO uncomment below to create an instance of ZeroBasedEnumClass
|
||||
//instance = new ZeroBasedEnumClass();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of ZeroBasedEnumClass
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ZeroBasedEnumClassInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsType" ZeroBasedEnumClass
|
||||
//Assert.IsType<ZeroBasedEnumClass>(instance);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ZeroBasedEnum'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ZeroBasedEnumTest()
|
||||
{
|
||||
// TODO unit test for the property 'ZeroBasedEnum'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,137 @@
|
||||
/*
|
||||
* 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 System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// ZeroBasedEnumClass
|
||||
/// </summary>
|
||||
[DataContract(Name = "ZeroBasedEnumClass")]
|
||||
public partial class ZeroBasedEnumClass : IEquatable<ZeroBasedEnumClass>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines ZeroBasedEnum
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum ZeroBasedEnumEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum Unknown for value: unknown
|
||||
/// </summary>
|
||||
[EnumMember(Value = "unknown")]
|
||||
Unknown,
|
||||
|
||||
/// <summary>
|
||||
/// Enum NotUnknown for value: notUnknown
|
||||
/// </summary>
|
||||
[EnumMember(Value = "notUnknown")]
|
||||
NotUnknown
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ZeroBasedEnum
|
||||
/// </summary>
|
||||
[DataMember(Name = "ZeroBasedEnum", EmitDefaultValue = false)]
|
||||
public ZeroBasedEnumEnum? ZeroBasedEnum { get; set; }
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ZeroBasedEnumClass" /> class.
|
||||
/// </summary>
|
||||
/// <param name="zeroBasedEnum">zeroBasedEnum.</param>
|
||||
public ZeroBasedEnumClass(ZeroBasedEnumEnum? zeroBasedEnum = default(ZeroBasedEnumEnum?))
|
||||
{
|
||||
this.ZeroBasedEnum = zeroBasedEnum;
|
||||
}
|
||||
|
||||
/// <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 ZeroBasedEnumClass {\n");
|
||||
sb.Append(" ZeroBasedEnum: ").Append(ZeroBasedEnum).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 OpenAPIClientUtils.compareLogic.Compare(this, input as ZeroBasedEnumClass).AreEqual;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if ZeroBasedEnumClass instances are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of ZeroBasedEnumClass to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(ZeroBasedEnumClass input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
/// <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.ZeroBasedEnum.GetHashCode();
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user