handled nullable inner enums better (#17128)

This commit is contained in:
devhl-labs 2023-11-26 08:45:25 -05:00 committed by GitHub
parent 4c6dbfe7d6
commit 8bea7f7377
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
68 changed files with 226 additions and 291 deletions

View File

@ -1467,7 +1467,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
properties.put(NET_70_OR_LATER, true);
properties.put(NET_80_OR_LATER, true);
} else {
throw new RuntimeException("Unhanlded case");
throw new RuntimeException("Unhandled case");
}
}
}

View File

@ -438,12 +438,18 @@
{{^isMap}}
{{^isNumeric}}
{{#isInnerEnum}}
{{#isNullable}}
var {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}RawValue = {{classname}}.{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_param}}{{classname}}{{/lambda.camelcase_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}{{nrt!}}.Value{{/isNullable}}{{/required}});
if ({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}RawValue != null)
writer.WriteString("{{baseName}}", {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}RawValue);
else
writer.WriteNull("{{baseName}}");
{{/isNullable}}
{{^isNullable}}
var {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}RawValue = {{classname}}.{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_param}}{{classname}}{{/lambda.camelcase_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}{{nrt!}}.Value{{/isNullable}}{{/required}});
writer.WriteString("{{baseName}}", {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}RawValue);
{{/isNullable}}
{{/isInnerEnum}}
{{^isInnerEnum}}
{{#lambda.copy}}

View File

@ -74,7 +74,7 @@
{{#isString}}
/// <exception cref="NotImplementedException"></exception>
{{/isString}}
public static {{>EnumValueDataType}}{{#nrt}}{{#isString}}{{#isNullable}}{{nrt?}} {{^nrt}}{{#vendorExtensions.x-is-value-type}}? {{/vendorExtensions.x-is-value-type}}{{/nrt}}{{/isNullable}}{{/isString}}{{/nrt}} {{datatypeWithEnum}}ToJsonValue({{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#isString}}{{>NullConditionalProperty}}{{/isString}} value)
public static {{>EnumValueDataType}}{{#lambda.first}}{{#nrt}}{{#isString}}{{#isNullable}}{{nrt?}} {{^nrt}}{{#vendorExtensions.x-is-value-type}}? {{/vendorExtensions.x-is-value-type}}{{/nrt}}{{/isNullable}}{{/isString}}{{/nrt}}{{/lambda.first}} {{datatypeWithEnum}}ToJsonValue({{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#isString}}{{>NullConditionalProperty}}{{/isString}} value)
{
{{^isString}}
return ({{>EnumValueDataType}}) value;

View File

@ -2549,6 +2549,8 @@ components:
enum:
- ChildCat
default: ChildCat
required:
- pet_type
ArrayOfEnums:
type: array
items:

View File

@ -2491,6 +2491,8 @@ components:
- ChildCat
type: string
x-enum-as-string: true
required:
- pet_type
type: object
ArrayOfEnums:
items:

View File

@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional]
**PetType** | **string** | | [optional] [default to PetTypeEnum.ChildCat]
**PetType** | **string** | | [default to PetTypeEnum.ChildCat]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -52,8 +52,8 @@ namespace Org.OpenAPITools.Model
/// Gets or Sets PetType
/// </summary>
[DataMember(Name = "pet_type", EmitDefaultValue = false)]
public PetTypeEnum? PetType
[DataMember(Name = "pet_type", IsRequired = true, EmitDefaultValue = true)]
public PetTypeEnum PetType
{
get{ return _PetType;}
set
@ -62,7 +62,7 @@ namespace Org.OpenAPITools.Model
_flagPetType = true;
}
}
private PetTypeEnum? _PetType;
private PetTypeEnum _PetType;
private bool _flagPetType;
/// <summary>
@ -76,10 +76,19 @@ namespace Org.OpenAPITools.Model
/// <summary>
/// Initializes a new instance of the <see cref="ChildCat" /> class.
/// </summary>
/// <param name="name">name.</param>
/// <param name="petType">petType (default to PetTypeEnum.ChildCat).</param>
public ChildCat(string name = default(string), PetTypeEnum? petType = PetTypeEnum.ChildCat) : base()
[JsonConstructorAttribute]
protected ChildCat()
{
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
/// Initializes a new instance of the <see cref="ChildCat" /> class.
/// </summary>
/// <param name="name">name.</param>
/// <param name="petType">petType (required) (default to PetTypeEnum.ChildCat).</param>
public ChildCat(string name = default(string), PetTypeEnum petType = PetTypeEnum.ChildCat) : base()
{
this._PetType = petType;
this._Name = name;
if (this.Name != null)
{

View File

@ -2491,6 +2491,8 @@ components:
- ChildCat
type: string
x-enum-as-string: true
required:
- pet_type
type: object
ArrayOfEnums:
items:

View File

@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional]
**PetType** | **string** | | [optional] [default to PetTypeEnum.ChildCat]
**PetType** | **string** | | [default to PetTypeEnum.ChildCat]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -38,10 +38,10 @@ namespace UseSourceGeneration.Model
/// <param name="name">name</param>
/// <param name="petType">petType (default to PetTypeEnum.ChildCat)</param>
[JsonConstructor]
public ChildCat(Option<string?> name = default, Option<PetTypeEnum?> petType = default) : base(ChildCat.PetTypeEnumToJsonValue(petType.Value))
public ChildCat(Option<string?> name = default, PetTypeEnum petType = PetTypeEnum.ChildCat) : base(ChildCat.PetTypeEnumToJsonValue(petType))
{
NameOption = name;
PetTypeOption = petType;
PetType = petType;
OnCreated();
}
@ -91,7 +91,7 @@ namespace UseSourceGeneration.Model
/// <param name="value"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
public static string PetTypeEnumToJsonValue(PetTypeEnum? value)
public static string PetTypeEnumToJsonValue(PetTypeEnum value)
{
if (value == PetTypeEnum.ChildCat)
return "ChildCat";
@ -99,18 +99,11 @@ namespace UseSourceGeneration.Model
throw new NotImplementedException($"Value could not be handled: '{value}'");
}
/// <summary>
/// Used to track the state of PetType
/// </summary>
[JsonIgnore]
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public new Option<PetTypeEnum?> PetTypeOption { get; private set; }
/// <summary>
/// Gets or Sets PetType
/// </summary>
[JsonPropertyName("pet_type")]
public new PetTypeEnum? PetType { get { return this.PetTypeOption; } set { this.PetTypeOption = new(value); } }
public new PetTypeEnum PetType { get; set; }
/// <summary>
/// Used to track the state of Name
@ -195,13 +188,16 @@ namespace UseSourceGeneration.Model
}
}
if (!petType.IsSet)
throw new ArgumentException("Property is required for class ChildCat.", nameof(petType));
if (name.IsSet && name.Value == null)
throw new ArgumentNullException(nameof(name), "Property is not nullable for class ChildCat.");
if (petType.IsSet && petType.Value == null)
throw new ArgumentNullException(nameof(petType), "Property is not nullable for class ChildCat.");
return new ChildCat(name, petType);
return new ChildCat(name, petType.Value!.Value!);
}
/// <summary>
@ -234,11 +230,8 @@ namespace UseSourceGeneration.Model
if (childCat.NameOption.IsSet)
writer.WriteString("name", childCat.Name);
var petTypeRawValue = ChildCat.PetTypeEnumToJsonValue(childCat.PetTypeOption.Value!.Value);
if (petTypeRawValue != null)
var petTypeRawValue = ChildCat.PetTypeEnumToJsonValue(childCat.PetType);
writer.WriteString("pet_type", petTypeRawValue);
else
writer.WriteNull("pet_type");
}
}

View File

@ -334,10 +334,7 @@ namespace UseSourceGeneration.Model
JsonSerializer.Serialize(writer, enumArrays.ArrayEnum, jsonSerializerOptions);
}
var justSymbolRawValue = EnumArrays.JustSymbolEnumToJsonValue(enumArrays.JustSymbolOption.Value!.Value);
if (justSymbolRawValue != null)
writer.WriteString("just_symbol", justSymbolRawValue);
else
writer.WriteNull("just_symbol");
}
}

View File

@ -844,11 +844,7 @@ namespace UseSourceGeneration.Model
public void WriteProperties(ref Utf8JsonWriter writer, EnumTest enumTest, JsonSerializerOptions jsonSerializerOptions)
{
var enumStringRequiredRawValue = EnumTest.EnumStringRequiredEnumToJsonValue(enumTest.EnumStringRequired);
if (enumStringRequiredRawValue != null)
writer.WriteString("enum_string_required", enumStringRequiredRawValue);
else
writer.WriteNull("enum_string_required");
if (enumTest.EnumIntegerOption.IsSet)
writer.WriteNumber("enum_integer", EnumTest.EnumIntegerEnumToJsonValue(enumTest.EnumIntegerOption.Value!.Value));
@ -859,11 +855,7 @@ namespace UseSourceGeneration.Model
writer.WriteNumber("enum_number", EnumTest.EnumNumberEnumToJsonValue(enumTest.EnumNumberOption.Value!.Value));
var enumStringRawValue = EnumTest.EnumStringEnumToJsonValue(enumTest.EnumStringOption.Value!.Value);
if (enumStringRawValue != null)
writer.WriteString("enum_string", enumStringRawValue);
else
writer.WriteNull("enum_string");
if (enumTest.OuterEnumOption.IsSet)
if (enumTest.OuterEnumOption!.Value != null)
{

View File

@ -393,10 +393,7 @@ namespace UseSourceGeneration.Model
writer.WriteString("shipDate", order.ShipDateOption.Value!.Value.ToString(ShipDateFormat));
var statusRawValue = Order.StatusEnumToJsonValue(order.StatusOption.Value!.Value);
if (statusRawValue != null)
writer.WriteString("status", statusRawValue);
else
writer.WriteNull("status");
}
}

View File

@ -388,11 +388,7 @@ namespace UseSourceGeneration.Model
writer.WriteNumber("id", pet.IdOption.Value!.Value);
var statusRawValue = Pet.StatusEnumToJsonValue(pet.StatusOption.Value!.Value);
if (statusRawValue != null)
writer.WriteString("status", statusRawValue);
else
writer.WriteNull("status");
if (pet.TagsOption.IsSet)
{
writer.WritePropertyName("tags");

View File

@ -2197,11 +2197,7 @@ namespace UseSourceGeneration.Model
writer.WriteNumber("required_notnullable_enum_integer_only", RequiredClass.RequiredNotnullableEnumIntegerOnlyEnumToJsonValue(requiredClass.RequiredNotnullableEnumIntegerOnly));
var requiredNotnullableEnumStringRawValue = RequiredClass.RequiredNotnullableEnumStringEnumToJsonValue(requiredClass.RequiredNotnullableEnumString);
if (requiredNotnullableEnumStringRawValue != null)
writer.WriteString("required_notnullable_enum_string", requiredNotnullableEnumStringRawValue);
else
writer.WriteNull("required_notnullable_enum_string");
var requiredNotnullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.RequiredNotnullableOuterEnumDefaultValue);
writer.WriteString("required_notnullable_outerEnumDefaultValue", requiredNotnullableOuterEnumDefaultValueRawValue);
@ -2311,11 +2307,7 @@ namespace UseSourceGeneration.Model
writer.WriteNumber("notrequired_notnullable_enum_integer_only", RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnumToJsonValue(requiredClass.NotrequiredNotnullableEnumIntegerOnlyOption.Value!.Value));
var notrequiredNotnullableEnumStringRawValue = RequiredClass.NotrequiredNotnullableEnumStringEnumToJsonValue(requiredClass.NotrequiredNotnullableEnumStringOption.Value!.Value);
if (notrequiredNotnullableEnumStringRawValue != null)
writer.WriteString("notrequired_notnullable_enum_string", notrequiredNotnullableEnumStringRawValue);
else
writer.WriteNull("notrequired_notnullable_enum_string");
if (requiredClass.NotrequiredNotnullableOuterEnumDefaultValueOption.IsSet)
{
var notrequiredNotnullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.NotrequiredNotnullableOuterEnumDefaultValue!.Value);

View File

@ -285,10 +285,7 @@ namespace UseSourceGeneration.Model
writer.WriteString("className", zebra.ClassName);
var typeRawValue = Zebra.TypeEnumToJsonValue(zebra.TypeOption.Value!.Value);
if (typeRawValue != null)
writer.WriteString("type", typeRawValue);
else
writer.WriteNull("type");
}
}

View File

@ -236,10 +236,7 @@ namespace UseSourceGeneration.Model
public void WriteProperties(ref Utf8JsonWriter writer, ZeroBasedEnumClass zeroBasedEnumClass, JsonSerializerOptions jsonSerializerOptions)
{
var zeroBasedEnumRawValue = ZeroBasedEnumClass.ZeroBasedEnumEnumToJsonValue(zeroBasedEnumClass.ZeroBasedEnumOption.Value!.Value);
if (zeroBasedEnumRawValue != null)
writer.WriteString("ZeroBasedEnum", zeroBasedEnumRawValue);
else
writer.WriteNull("ZeroBasedEnum");
}
}

View File

@ -2491,6 +2491,8 @@ components:
- ChildCat
type: string
x-enum-as-string: true
required:
- pet_type
type: object
ArrayOfEnums:
items:

View File

@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional]
**PetType** | **string** | | [optional] [default to PetTypeEnum.ChildCat]
**PetType** | **string** | | [default to PetTypeEnum.ChildCat]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -37,10 +37,10 @@ namespace Org.OpenAPITools.Model
/// <param name="name">name</param>
/// <param name="petType">petType (default to PetTypeEnum.ChildCat)</param>
[JsonConstructor]
public ChildCat(Option<string?> name = default, Option<PetTypeEnum?> petType = default) : base(ChildCat.PetTypeEnumToJsonValue(petType.Value))
public ChildCat(Option<string?> name = default, PetTypeEnum petType = PetTypeEnum.ChildCat) : base(ChildCat.PetTypeEnumToJsonValue(petType))
{
NameOption = name;
PetTypeOption = petType;
PetType = petType;
OnCreated();
}
@ -90,7 +90,7 @@ namespace Org.OpenAPITools.Model
/// <param name="value"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
public static string PetTypeEnumToJsonValue(PetTypeEnum? value)
public static string PetTypeEnumToJsonValue(PetTypeEnum value)
{
if (value == PetTypeEnum.ChildCat)
return "ChildCat";
@ -98,18 +98,11 @@ namespace Org.OpenAPITools.Model
throw new NotImplementedException($"Value could not be handled: '{value}'");
}
/// <summary>
/// Used to track the state of PetType
/// </summary>
[JsonIgnore]
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public new Option<PetTypeEnum?> PetTypeOption { get; private set; }
/// <summary>
/// Gets or Sets PetType
/// </summary>
[JsonPropertyName("pet_type")]
public new PetTypeEnum? PetType { get { return this.PetTypeOption; } set { this.PetTypeOption = new(value); } }
public new PetTypeEnum PetType { get; set; }
/// <summary>
/// Used to track the state of Name
@ -194,13 +187,16 @@ namespace Org.OpenAPITools.Model
}
}
if (!petType.IsSet)
throw new ArgumentException("Property is required for class ChildCat.", nameof(petType));
if (name.IsSet && name.Value == null)
throw new ArgumentNullException(nameof(name), "Property is not nullable for class ChildCat.");
if (petType.IsSet && petType.Value == null)
throw new ArgumentNullException(nameof(petType), "Property is not nullable for class ChildCat.");
return new ChildCat(name, petType);
return new ChildCat(name, petType.Value!.Value!);
}
/// <summary>
@ -233,11 +229,8 @@ namespace Org.OpenAPITools.Model
if (childCat.NameOption.IsSet)
writer.WriteString("name", childCat.Name);
var petTypeRawValue = ChildCat.PetTypeEnumToJsonValue(childCat.PetTypeOption.Value!.Value);
if (petTypeRawValue != null)
var petTypeRawValue = ChildCat.PetTypeEnumToJsonValue(childCat.PetType);
writer.WriteString("pet_type", petTypeRawValue);
else
writer.WriteNull("pet_type");
}
}
}

View File

@ -333,10 +333,7 @@ namespace Org.OpenAPITools.Model
JsonSerializer.Serialize(writer, enumArrays.ArrayEnum, jsonSerializerOptions);
}
var justSymbolRawValue = EnumArrays.JustSymbolEnumToJsonValue(enumArrays.JustSymbolOption.Value!.Value);
if (justSymbolRawValue != null)
writer.WriteString("just_symbol", justSymbolRawValue);
else
writer.WriteNull("just_symbol");
}
}
}

View File

@ -843,11 +843,7 @@ namespace Org.OpenAPITools.Model
public void WriteProperties(ref Utf8JsonWriter writer, EnumTest enumTest, JsonSerializerOptions jsonSerializerOptions)
{
var enumStringRequiredRawValue = EnumTest.EnumStringRequiredEnumToJsonValue(enumTest.EnumStringRequired);
if (enumStringRequiredRawValue != null)
writer.WriteString("enum_string_required", enumStringRequiredRawValue);
else
writer.WriteNull("enum_string_required");
if (enumTest.EnumIntegerOption.IsSet)
writer.WriteNumber("enum_integer", EnumTest.EnumIntegerEnumToJsonValue(enumTest.EnumIntegerOption.Value!.Value));
@ -858,11 +854,7 @@ namespace Org.OpenAPITools.Model
writer.WriteNumber("enum_number", EnumTest.EnumNumberEnumToJsonValue(enumTest.EnumNumberOption.Value!.Value));
var enumStringRawValue = EnumTest.EnumStringEnumToJsonValue(enumTest.EnumStringOption.Value!.Value);
if (enumStringRawValue != null)
writer.WriteString("enum_string", enumStringRawValue);
else
writer.WriteNull("enum_string");
if (enumTest.OuterEnumOption.IsSet)
if (enumTest.OuterEnumOption!.Value != null)
{

View File

@ -392,10 +392,7 @@ namespace Org.OpenAPITools.Model
writer.WriteString("shipDate", order.ShipDateOption.Value!.Value.ToString(ShipDateFormat));
var statusRawValue = Order.StatusEnumToJsonValue(order.StatusOption.Value!.Value);
if (statusRawValue != null)
writer.WriteString("status", statusRawValue);
else
writer.WriteNull("status");
}
}
}

View File

@ -387,11 +387,7 @@ namespace Org.OpenAPITools.Model
writer.WriteNumber("id", pet.IdOption.Value!.Value);
var statusRawValue = Pet.StatusEnumToJsonValue(pet.StatusOption.Value!.Value);
if (statusRawValue != null)
writer.WriteString("status", statusRawValue);
else
writer.WriteNull("status");
if (pet.TagsOption.IsSet)
{
writer.WritePropertyName("tags");

View File

@ -2196,11 +2196,7 @@ namespace Org.OpenAPITools.Model
writer.WriteNumber("required_notnullable_enum_integer_only", RequiredClass.RequiredNotnullableEnumIntegerOnlyEnumToJsonValue(requiredClass.RequiredNotnullableEnumIntegerOnly));
var requiredNotnullableEnumStringRawValue = RequiredClass.RequiredNotnullableEnumStringEnumToJsonValue(requiredClass.RequiredNotnullableEnumString);
if (requiredNotnullableEnumStringRawValue != null)
writer.WriteString("required_notnullable_enum_string", requiredNotnullableEnumStringRawValue);
else
writer.WriteNull("required_notnullable_enum_string");
var requiredNotnullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.RequiredNotnullableOuterEnumDefaultValue);
writer.WriteString("required_notnullable_outerEnumDefaultValue", requiredNotnullableOuterEnumDefaultValueRawValue);
@ -2310,11 +2306,7 @@ namespace Org.OpenAPITools.Model
writer.WriteNumber("notrequired_notnullable_enum_integer_only", RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnumToJsonValue(requiredClass.NotrequiredNotnullableEnumIntegerOnlyOption.Value!.Value));
var notrequiredNotnullableEnumStringRawValue = RequiredClass.NotrequiredNotnullableEnumStringEnumToJsonValue(requiredClass.NotrequiredNotnullableEnumStringOption.Value!.Value);
if (notrequiredNotnullableEnumStringRawValue != null)
writer.WriteString("notrequired_notnullable_enum_string", notrequiredNotnullableEnumStringRawValue);
else
writer.WriteNull("notrequired_notnullable_enum_string");
if (requiredClass.NotrequiredNotnullableOuterEnumDefaultValueOption.IsSet)
{
var notrequiredNotnullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.NotrequiredNotnullableOuterEnumDefaultValue!.Value);

View File

@ -284,10 +284,7 @@ namespace Org.OpenAPITools.Model
writer.WriteString("className", zebra.ClassName);
var typeRawValue = Zebra.TypeEnumToJsonValue(zebra.TypeOption.Value!.Value);
if (typeRawValue != null)
writer.WriteString("type", typeRawValue);
else
writer.WriteNull("type");
}
}
}

View File

@ -235,10 +235,7 @@ namespace Org.OpenAPITools.Model
public void WriteProperties(ref Utf8JsonWriter writer, ZeroBasedEnumClass zeroBasedEnumClass, JsonSerializerOptions jsonSerializerOptions)
{
var zeroBasedEnumRawValue = ZeroBasedEnumClass.ZeroBasedEnumEnumToJsonValue(zeroBasedEnumClass.ZeroBasedEnumOption.Value!.Value);
if (zeroBasedEnumRawValue != null)
writer.WriteString("ZeroBasedEnum", zeroBasedEnumRawValue);
else
writer.WriteNull("ZeroBasedEnum");
}
}
}

View File

@ -2491,6 +2491,8 @@ components:
- ChildCat
type: string
x-enum-as-string: true
required:
- pet_type
type: object
ArrayOfEnums:
items:

View File

@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional]
**PetType** | **string** | | [optional] [default to PetTypeEnum.ChildCat]
**PetType** | **string** | | [default to PetTypeEnum.ChildCat]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -35,10 +35,10 @@ namespace Org.OpenAPITools.Model
/// <param name="name">name</param>
/// <param name="petType">petType (default to PetTypeEnum.ChildCat)</param>
[JsonConstructor]
public ChildCat(Option<string> name = default, Option<PetTypeEnum?> petType = default) : base(ChildCat.PetTypeEnumToJsonValue(petType.Value))
public ChildCat(Option<string> name = default, PetTypeEnum petType = PetTypeEnum.ChildCat) : base(ChildCat.PetTypeEnumToJsonValue(petType))
{
NameOption = name;
PetTypeOption = petType;
PetType = petType;
OnCreated();
}
@ -88,7 +88,7 @@ namespace Org.OpenAPITools.Model
/// <param name="value"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
public static string PetTypeEnumToJsonValue(PetTypeEnum? value)
public static string PetTypeEnumToJsonValue(PetTypeEnum value)
{
if (value == PetTypeEnum.ChildCat)
return "ChildCat";
@ -96,18 +96,11 @@ namespace Org.OpenAPITools.Model
throw new NotImplementedException($"Value could not be handled: '{value}'");
}
/// <summary>
/// Used to track the state of PetType
/// </summary>
[JsonIgnore]
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public new Option<PetTypeEnum?> PetTypeOption { get; private set; }
/// <summary>
/// Gets or Sets PetType
/// </summary>
[JsonPropertyName("pet_type")]
public new PetTypeEnum? PetType { get { return this.PetTypeOption; } set { this.PetTypeOption = new(value); } }
public new PetTypeEnum PetType { get; set; }
/// <summary>
/// Used to track the state of Name
@ -192,13 +185,16 @@ namespace Org.OpenAPITools.Model
}
}
if (!petType.IsSet)
throw new ArgumentException("Property is required for class ChildCat.", nameof(petType));
if (name.IsSet && name.Value == null)
throw new ArgumentNullException(nameof(name), "Property is not nullable for class ChildCat.");
if (petType.IsSet && petType.Value == null)
throw new ArgumentNullException(nameof(petType), "Property is not nullable for class ChildCat.");
return new ChildCat(name, petType);
return new ChildCat(name, petType.Value.Value);
}
/// <summary>
@ -231,11 +227,8 @@ namespace Org.OpenAPITools.Model
if (childCat.NameOption.IsSet)
writer.WriteString("name", childCat.Name);
var petTypeRawValue = ChildCat.PetTypeEnumToJsonValue(childCat.PetTypeOption.Value.Value);
if (petTypeRawValue != null)
var petTypeRawValue = ChildCat.PetTypeEnumToJsonValue(childCat.PetType);
writer.WriteString("pet_type", petTypeRawValue);
else
writer.WriteNull("pet_type");
}
}
}

View File

@ -331,10 +331,7 @@ namespace Org.OpenAPITools.Model
JsonSerializer.Serialize(writer, enumArrays.ArrayEnum, jsonSerializerOptions);
}
var justSymbolRawValue = EnumArrays.JustSymbolEnumToJsonValue(enumArrays.JustSymbolOption.Value.Value);
if (justSymbolRawValue != null)
writer.WriteString("just_symbol", justSymbolRawValue);
else
writer.WriteNull("just_symbol");
}
}
}

View File

@ -841,11 +841,7 @@ namespace Org.OpenAPITools.Model
public void WriteProperties(ref Utf8JsonWriter writer, EnumTest enumTest, JsonSerializerOptions jsonSerializerOptions)
{
var enumStringRequiredRawValue = EnumTest.EnumStringRequiredEnumToJsonValue(enumTest.EnumStringRequired);
if (enumStringRequiredRawValue != null)
writer.WriteString("enum_string_required", enumStringRequiredRawValue);
else
writer.WriteNull("enum_string_required");
if (enumTest.EnumIntegerOption.IsSet)
writer.WriteNumber("enum_integer", EnumTest.EnumIntegerEnumToJsonValue(enumTest.EnumIntegerOption.Value.Value));
@ -856,11 +852,7 @@ namespace Org.OpenAPITools.Model
writer.WriteNumber("enum_number", EnumTest.EnumNumberEnumToJsonValue(enumTest.EnumNumberOption.Value.Value));
var enumStringRawValue = EnumTest.EnumStringEnumToJsonValue(enumTest.EnumStringOption.Value.Value);
if (enumStringRawValue != null)
writer.WriteString("enum_string", enumStringRawValue);
else
writer.WriteNull("enum_string");
if (enumTest.OuterEnumOption.IsSet)
if (enumTest.OuterEnumOption.Value != null)
{

View File

@ -390,10 +390,7 @@ namespace Org.OpenAPITools.Model
writer.WriteString("shipDate", order.ShipDateOption.Value.Value.ToString(ShipDateFormat));
var statusRawValue = Order.StatusEnumToJsonValue(order.StatusOption.Value.Value);
if (statusRawValue != null)
writer.WriteString("status", statusRawValue);
else
writer.WriteNull("status");
}
}
}

View File

@ -385,11 +385,7 @@ namespace Org.OpenAPITools.Model
writer.WriteNumber("id", pet.IdOption.Value.Value);
var statusRawValue = Pet.StatusEnumToJsonValue(pet.StatusOption.Value.Value);
if (statusRawValue != null)
writer.WriteString("status", statusRawValue);
else
writer.WriteNull("status");
if (pet.TagsOption.IsSet)
{
writer.WritePropertyName("tags");

View File

@ -2194,11 +2194,7 @@ namespace Org.OpenAPITools.Model
writer.WriteNumber("required_notnullable_enum_integer_only", RequiredClass.RequiredNotnullableEnumIntegerOnlyEnumToJsonValue(requiredClass.RequiredNotnullableEnumIntegerOnly));
var requiredNotnullableEnumStringRawValue = RequiredClass.RequiredNotnullableEnumStringEnumToJsonValue(requiredClass.RequiredNotnullableEnumString);
if (requiredNotnullableEnumStringRawValue != null)
writer.WriteString("required_notnullable_enum_string", requiredNotnullableEnumStringRawValue);
else
writer.WriteNull("required_notnullable_enum_string");
var requiredNotnullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.RequiredNotnullableOuterEnumDefaultValue);
writer.WriteString("required_notnullable_outerEnumDefaultValue", requiredNotnullableOuterEnumDefaultValueRawValue);
@ -2308,11 +2304,7 @@ namespace Org.OpenAPITools.Model
writer.WriteNumber("notrequired_notnullable_enum_integer_only", RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnumToJsonValue(requiredClass.NotrequiredNotnullableEnumIntegerOnlyOption.Value.Value));
var notrequiredNotnullableEnumStringRawValue = RequiredClass.NotrequiredNotnullableEnumStringEnumToJsonValue(requiredClass.NotrequiredNotnullableEnumStringOption.Value.Value);
if (notrequiredNotnullableEnumStringRawValue != null)
writer.WriteString("notrequired_notnullable_enum_string", notrequiredNotnullableEnumStringRawValue);
else
writer.WriteNull("notrequired_notnullable_enum_string");
if (requiredClass.NotrequiredNotnullableOuterEnumDefaultValueOption.IsSet)
{
var notrequiredNotnullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.NotrequiredNotnullableOuterEnumDefaultValue.Value);

View File

@ -282,10 +282,7 @@ namespace Org.OpenAPITools.Model
writer.WriteString("className", zebra.ClassName);
var typeRawValue = Zebra.TypeEnumToJsonValue(zebra.TypeOption.Value.Value);
if (typeRawValue != null)
writer.WriteString("type", typeRawValue);
else
writer.WriteNull("type");
}
}
}

View File

@ -233,10 +233,7 @@ namespace Org.OpenAPITools.Model
public void WriteProperties(ref Utf8JsonWriter writer, ZeroBasedEnumClass zeroBasedEnumClass, JsonSerializerOptions jsonSerializerOptions)
{
var zeroBasedEnumRawValue = ZeroBasedEnumClass.ZeroBasedEnumEnumToJsonValue(zeroBasedEnumClass.ZeroBasedEnumOption.Value.Value);
if (zeroBasedEnumRawValue != null)
writer.WriteString("ZeroBasedEnum", zeroBasedEnumRawValue);
else
writer.WriteNull("ZeroBasedEnum");
}
}
}

View File

@ -2491,6 +2491,8 @@ components:
- ChildCat
type: string
x-enum-as-string: true
required:
- pet_type
type: object
ArrayOfEnums:
items:

View File

@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional]
**PetType** | **string** | | [optional] [default to PetTypeEnum.ChildCat]
**PetType** | **string** | | [default to PetTypeEnum.ChildCat]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -35,10 +35,10 @@ namespace Org.OpenAPITools.Model
/// <param name="name">name</param>
/// <param name="petType">petType (default to PetTypeEnum.ChildCat)</param>
[JsonConstructor]
public ChildCat(Option<string> name = default, Option<PetTypeEnum?> petType = default) : base(ChildCat.PetTypeEnumToJsonValue(petType.Value))
public ChildCat(Option<string> name = default, PetTypeEnum petType = PetTypeEnum.ChildCat) : base(ChildCat.PetTypeEnumToJsonValue(petType))
{
NameOption = name;
PetTypeOption = petType;
PetType = petType;
OnCreated();
}
@ -88,7 +88,7 @@ namespace Org.OpenAPITools.Model
/// <param name="value"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
public static string PetTypeEnumToJsonValue(PetTypeEnum? value)
public static string PetTypeEnumToJsonValue(PetTypeEnum value)
{
if (value == PetTypeEnum.ChildCat)
return "ChildCat";
@ -96,18 +96,11 @@ namespace Org.OpenAPITools.Model
throw new NotImplementedException($"Value could not be handled: '{value}'");
}
/// <summary>
/// Used to track the state of PetType
/// </summary>
[JsonIgnore]
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public new Option<PetTypeEnum?> PetTypeOption { get; private set; }
/// <summary>
/// Gets or Sets PetType
/// </summary>
[JsonPropertyName("pet_type")]
public new PetTypeEnum? PetType { get { return this.PetTypeOption; } set { this.PetTypeOption = new Option<PetTypeEnum?>(value); } }
public new PetTypeEnum PetType { get; set; }
/// <summary>
/// Used to track the state of Name
@ -192,13 +185,16 @@ namespace Org.OpenAPITools.Model
}
}
if (!petType.IsSet)
throw new ArgumentException("Property is required for class ChildCat.", nameof(petType));
if (name.IsSet && name.Value == null)
throw new ArgumentNullException(nameof(name), "Property is not nullable for class ChildCat.");
if (petType.IsSet && petType.Value == null)
throw new ArgumentNullException(nameof(petType), "Property is not nullable for class ChildCat.");
return new ChildCat(name, petType);
return new ChildCat(name, petType.Value.Value);
}
/// <summary>
@ -231,11 +227,8 @@ namespace Org.OpenAPITools.Model
if (childCat.NameOption.IsSet)
writer.WriteString("name", childCat.Name);
var petTypeRawValue = ChildCat.PetTypeEnumToJsonValue(childCat.PetTypeOption.Value.Value);
if (petTypeRawValue != null)
var petTypeRawValue = ChildCat.PetTypeEnumToJsonValue(childCat.PetType);
writer.WriteString("pet_type", petTypeRawValue);
else
writer.WriteNull("pet_type");
}
}
}

View File

@ -331,10 +331,7 @@ namespace Org.OpenAPITools.Model
JsonSerializer.Serialize(writer, enumArrays.ArrayEnum, jsonSerializerOptions);
}
var justSymbolRawValue = EnumArrays.JustSymbolEnumToJsonValue(enumArrays.JustSymbolOption.Value.Value);
if (justSymbolRawValue != null)
writer.WriteString("just_symbol", justSymbolRawValue);
else
writer.WriteNull("just_symbol");
}
}
}

View File

@ -841,11 +841,7 @@ namespace Org.OpenAPITools.Model
public void WriteProperties(ref Utf8JsonWriter writer, EnumTest enumTest, JsonSerializerOptions jsonSerializerOptions)
{
var enumStringRequiredRawValue = EnumTest.EnumStringRequiredEnumToJsonValue(enumTest.EnumStringRequired);
if (enumStringRequiredRawValue != null)
writer.WriteString("enum_string_required", enumStringRequiredRawValue);
else
writer.WriteNull("enum_string_required");
if (enumTest.EnumIntegerOption.IsSet)
writer.WriteNumber("enum_integer", EnumTest.EnumIntegerEnumToJsonValue(enumTest.EnumIntegerOption.Value.Value));
@ -856,11 +852,7 @@ namespace Org.OpenAPITools.Model
writer.WriteNumber("enum_number", EnumTest.EnumNumberEnumToJsonValue(enumTest.EnumNumberOption.Value.Value));
var enumStringRawValue = EnumTest.EnumStringEnumToJsonValue(enumTest.EnumStringOption.Value.Value);
if (enumStringRawValue != null)
writer.WriteString("enum_string", enumStringRawValue);
else
writer.WriteNull("enum_string");
if (enumTest.OuterEnumOption.IsSet)
if (enumTest.OuterEnumOption.Value != null)
{

View File

@ -390,10 +390,7 @@ namespace Org.OpenAPITools.Model
writer.WriteString("shipDate", order.ShipDateOption.Value.Value.ToString(ShipDateFormat));
var statusRawValue = Order.StatusEnumToJsonValue(order.StatusOption.Value.Value);
if (statusRawValue != null)
writer.WriteString("status", statusRawValue);
else
writer.WriteNull("status");
}
}
}

View File

@ -385,11 +385,7 @@ namespace Org.OpenAPITools.Model
writer.WriteNumber("id", pet.IdOption.Value.Value);
var statusRawValue = Pet.StatusEnumToJsonValue(pet.StatusOption.Value.Value);
if (statusRawValue != null)
writer.WriteString("status", statusRawValue);
else
writer.WriteNull("status");
if (pet.TagsOption.IsSet)
{
writer.WritePropertyName("tags");

View File

@ -2194,11 +2194,7 @@ namespace Org.OpenAPITools.Model
writer.WriteNumber("required_notnullable_enum_integer_only", RequiredClass.RequiredNotnullableEnumIntegerOnlyEnumToJsonValue(requiredClass.RequiredNotnullableEnumIntegerOnly));
var requiredNotnullableEnumStringRawValue = RequiredClass.RequiredNotnullableEnumStringEnumToJsonValue(requiredClass.RequiredNotnullableEnumString);
if (requiredNotnullableEnumStringRawValue != null)
writer.WriteString("required_notnullable_enum_string", requiredNotnullableEnumStringRawValue);
else
writer.WriteNull("required_notnullable_enum_string");
var requiredNotnullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.RequiredNotnullableOuterEnumDefaultValue);
writer.WriteString("required_notnullable_outerEnumDefaultValue", requiredNotnullableOuterEnumDefaultValueRawValue);
@ -2308,11 +2304,7 @@ namespace Org.OpenAPITools.Model
writer.WriteNumber("notrequired_notnullable_enum_integer_only", RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnumToJsonValue(requiredClass.NotrequiredNotnullableEnumIntegerOnlyOption.Value.Value));
var notrequiredNotnullableEnumStringRawValue = RequiredClass.NotrequiredNotnullableEnumStringEnumToJsonValue(requiredClass.NotrequiredNotnullableEnumStringOption.Value.Value);
if (notrequiredNotnullableEnumStringRawValue != null)
writer.WriteString("notrequired_notnullable_enum_string", notrequiredNotnullableEnumStringRawValue);
else
writer.WriteNull("notrequired_notnullable_enum_string");
if (requiredClass.NotrequiredNotnullableOuterEnumDefaultValueOption.IsSet)
{
var notrequiredNotnullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.NotrequiredNotnullableOuterEnumDefaultValue.Value);

View File

@ -282,10 +282,7 @@ namespace Org.OpenAPITools.Model
writer.WriteString("className", zebra.ClassName);
var typeRawValue = Zebra.TypeEnumToJsonValue(zebra.TypeOption.Value.Value);
if (typeRawValue != null)
writer.WriteString("type", typeRawValue);
else
writer.WriteNull("type");
}
}
}

View File

@ -233,10 +233,7 @@ namespace Org.OpenAPITools.Model
public void WriteProperties(ref Utf8JsonWriter writer, ZeroBasedEnumClass zeroBasedEnumClass, JsonSerializerOptions jsonSerializerOptions)
{
var zeroBasedEnumRawValue = ZeroBasedEnumClass.ZeroBasedEnumEnumToJsonValue(zeroBasedEnumClass.ZeroBasedEnumOption.Value.Value);
if (zeroBasedEnumRawValue != null)
writer.WriteString("ZeroBasedEnum", zeroBasedEnumRawValue);
else
writer.WriteNull("ZeroBasedEnum");
}
}
}

View File

@ -2491,6 +2491,8 @@ components:
- ChildCat
type: string
x-enum-as-string: true
required:
- pet_type
type: object
ArrayOfEnums:
items:

View File

@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional]
**PetType** | **string** | | [optional] [default to PetTypeEnum.ChildCat]
**PetType** | **string** | | [default to PetTypeEnum.ChildCat]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -52,17 +52,25 @@ namespace Org.OpenAPITools.Model
/// <summary>
/// Gets or Sets PetType
/// </summary>
[DataMember(Name = "pet_type", EmitDefaultValue = false)]
public PetTypeEnum? PetType { get; set; }
[DataMember(Name = "pet_type", IsRequired = true, EmitDefaultValue = true)]
public PetTypeEnum PetType { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="ChildCat" /> class.
/// </summary>
[JsonConstructorAttribute]
protected ChildCat()
{
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
/// Initializes a new instance of the <see cref="ChildCat" /> class.
/// </summary>
/// <param name="name">name.</param>
/// <param name="petType">petType (default to PetTypeEnum.ChildCat).</param>
public ChildCat(string name = default(string), PetTypeEnum? petType = PetTypeEnum.ChildCat) : base()
/// <param name="petType">petType (required) (default to PetTypeEnum.ChildCat).</param>
public ChildCat(string name = default(string), PetTypeEnum petType = PetTypeEnum.ChildCat) : base()
{
this.Name = name;
this.PetType = petType;
this.Name = name;
this.AdditionalProperties = new Dictionary<string, object>();
}

View File

@ -2491,6 +2491,8 @@ components:
- ChildCat
type: string
x-enum-as-string: true
required:
- pet_type
type: object
ArrayOfEnums:
items:

View File

@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional]
**PetType** | **string** | | [optional] [default to PetTypeEnum.ChildCat]
**PetType** | **string** | | [default to PetTypeEnum.ChildCat]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -51,17 +51,25 @@ namespace Org.OpenAPITools.Model
/// <summary>
/// Gets or Sets PetType
/// </summary>
[DataMember(Name = "pet_type", EmitDefaultValue = false)]
public PetTypeEnum? PetType { get; set; }
[DataMember(Name = "pet_type", IsRequired = true, EmitDefaultValue = true)]
public PetTypeEnum PetType { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="ChildCat" /> class.
/// </summary>
[JsonConstructorAttribute]
protected ChildCat()
{
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
/// Initializes a new instance of the <see cref="ChildCat" /> class.
/// </summary>
/// <param name="name">name.</param>
/// <param name="petType">petType (default to PetTypeEnum.ChildCat).</param>
public ChildCat(string name = default(string), PetTypeEnum? petType = PetTypeEnum.ChildCat) : base()
/// <param name="petType">petType (required) (default to PetTypeEnum.ChildCat).</param>
public ChildCat(string name = default(string), PetTypeEnum petType = PetTypeEnum.ChildCat) : base()
{
this.Name = name;
this.PetType = petType;
this.Name = name;
this.AdditionalProperties = new Dictionary<string, object>();
}

View File

@ -2491,6 +2491,8 @@ components:
- ChildCat
type: string
x-enum-as-string: true
required:
- pet_type
type: object
ArrayOfEnums:
items:

View File

@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional]
**PetType** | **string** | | [optional] [default to PetTypeEnum.ChildCat]
**PetType** | **string** | | [default to PetTypeEnum.ChildCat]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -51,17 +51,25 @@ namespace Org.OpenAPITools.Model
/// <summary>
/// Gets or Sets PetType
/// </summary>
[DataMember(Name = "pet_type", EmitDefaultValue = false)]
public PetTypeEnum? PetType { get; set; }
[DataMember(Name = "pet_type", IsRequired = true, EmitDefaultValue = true)]
public PetTypeEnum PetType { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="ChildCat" /> class.
/// </summary>
[JsonConstructorAttribute]
protected ChildCat()
{
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
/// Initializes a new instance of the <see cref="ChildCat" /> class.
/// </summary>
/// <param name="name">name.</param>
/// <param name="petType">petType (default to PetTypeEnum.ChildCat).</param>
public ChildCat(string name = default(string), PetTypeEnum? petType = PetTypeEnum.ChildCat) : base()
/// <param name="petType">petType (required) (default to PetTypeEnum.ChildCat).</param>
public ChildCat(string name = default(string), PetTypeEnum petType = PetTypeEnum.ChildCat) : base()
{
this.Name = name;
this.PetType = petType;
this.Name = name;
this.AdditionalProperties = new Dictionary<string, object>();
}

View File

@ -2491,6 +2491,8 @@ components:
- ChildCat
type: string
x-enum-as-string: true
required:
- pet_type
type: object
ArrayOfEnums:
items:

View File

@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional]
**PetType** | **string** | | [optional] [default to PetTypeEnum.ChildCat]
**PetType** | **string** | | [default to PetTypeEnum.ChildCat]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -51,17 +51,25 @@ namespace Org.OpenAPITools.Model
/// <summary>
/// Gets or Sets PetType
/// </summary>
[DataMember(Name = "pet_type", EmitDefaultValue = false)]
public PetTypeEnum? PetType { get; set; }
[DataMember(Name = "pet_type", IsRequired = true, EmitDefaultValue = true)]
public PetTypeEnum PetType { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="ChildCat" /> class.
/// </summary>
[JsonConstructorAttribute]
protected ChildCat()
{
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
/// Initializes a new instance of the <see cref="ChildCat" /> class.
/// </summary>
/// <param name="name">name.</param>
/// <param name="petType">petType (default to PetTypeEnum.ChildCat).</param>
public ChildCat(string name = default(string), PetTypeEnum? petType = PetTypeEnum.ChildCat) : base()
/// <param name="petType">petType (required) (default to PetTypeEnum.ChildCat).</param>
public ChildCat(string name = default(string), PetTypeEnum petType = PetTypeEnum.ChildCat) : base()
{
this.Name = name;
this.PetType = petType;
this.Name = name;
this.AdditionalProperties = new Dictionary<string, object>();
}

View File

@ -2491,6 +2491,8 @@ components:
- ChildCat
type: string
x-enum-as-string: true
required:
- pet_type
type: object
ArrayOfEnums:
items:

View File

@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional]
**PetType** | **string** | | [optional] [default to PetTypeEnum.ChildCat]
**PetType** | **string** | | [default to PetTypeEnum.ChildCat]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -47,17 +47,22 @@ namespace Org.OpenAPITools.Model
/// <summary>
/// Gets or Sets PetType
/// </summary>
[DataMember(Name = "pet_type", EmitDefaultValue = false)]
public PetTypeEnum? PetType { get; set; }
[DataMember(Name = "pet_type", IsRequired = true, EmitDefaultValue = true)]
public PetTypeEnum PetType { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="ChildCat" /> class.
/// </summary>
[JsonConstructorAttribute]
protected ChildCat() { }
/// <summary>
/// Initializes a new instance of the <see cref="ChildCat" /> class.
/// </summary>
/// <param name="name">name.</param>
/// <param name="petType">petType (default to PetTypeEnum.ChildCat).</param>
public ChildCat(string name = default(string), PetTypeEnum? petType = PetTypeEnum.ChildCat) : base()
/// <param name="petType">petType (required) (default to PetTypeEnum.ChildCat).</param>
public ChildCat(string name = default(string), PetTypeEnum petType = PetTypeEnum.ChildCat) : base()
{
this.Name = name;
this.PetType = petType;
this.Name = name;
}
/// <summary>

View File

@ -2491,6 +2491,8 @@ components:
- ChildCat
type: string
x-enum-as-string: true
required:
- pet_type
type: object
ArrayOfEnums:
items:

View File

@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional]
**PetType** | **string** | | [optional] [default to PetTypeEnum.ChildCat]
**PetType** | **string** | | [default to PetTypeEnum.ChildCat]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -51,17 +51,25 @@ namespace Org.OpenAPITools.Model
/// <summary>
/// Gets or Sets PetType
/// </summary>
[DataMember(Name = "pet_type", EmitDefaultValue = false)]
public PetTypeEnum? PetType { get; set; }
[DataMember(Name = "pet_type", IsRequired = true, EmitDefaultValue = true)]
public PetTypeEnum PetType { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="ChildCat" /> class.
/// </summary>
[JsonConstructorAttribute]
protected ChildCat()
{
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
/// Initializes a new instance of the <see cref="ChildCat" /> class.
/// </summary>
/// <param name="name">name.</param>
/// <param name="petType">petType (default to PetTypeEnum.ChildCat).</param>
public ChildCat(string name = default(string), PetTypeEnum? petType = PetTypeEnum.ChildCat) : base()
/// <param name="petType">petType (required) (default to PetTypeEnum.ChildCat).</param>
public ChildCat(string name = default(string), PetTypeEnum petType = PetTypeEnum.ChildCat) : base()
{
this.Name = name;
this.PetType = petType;
this.Name = name;
this.AdditionalProperties = new Dictionary<string, object>();
}

View File

@ -2491,6 +2491,8 @@ components:
- ChildCat
type: string
x-enum-as-string: true
required:
- pet_type
type: object
ArrayOfEnums:
items:

View File

@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional]
**PetType** | **string** | | [optional] [default to PetTypeEnum.ChildCat]
**PetType** | **string** | | [default to PetTypeEnum.ChildCat]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -51,17 +51,22 @@ namespace Org.OpenAPITools.Model
/// <summary>
/// Gets or Sets PetType
/// </summary>
[DataMember(Name = "pet_type", EmitDefaultValue = false)]
public PetTypeEnum? PetType { get; set; }
[DataMember(Name = "pet_type", IsRequired = true, EmitDefaultValue = true)]
public PetTypeEnum PetType { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="ChildCat" /> class.
/// </summary>
[JsonConstructorAttribute]
protected ChildCat() { }
/// <summary>
/// Initializes a new instance of the <see cref="ChildCat" /> class.
/// </summary>
/// <param name="name">name.</param>
/// <param name="petType">petType (default to PetTypeEnum.ChildCat).</param>
public ChildCat(string name = default(string), PetTypeEnum? petType = PetTypeEnum.ChildCat) : base()
/// <param name="petType">petType (required) (default to PetTypeEnum.ChildCat).</param>
public ChildCat(string name = default(string), PetTypeEnum petType = PetTypeEnum.ChildCat) : base()
{
this.Name = name;
this.PetType = petType;
this.Name = name;
}
/// <summary>