Fixes fromProperty when property is required vs optional (#12858)

* Adds required boolean to fromProperty

* Adds required to other method signatures

* pythn-exp sample regenerated

* Samples regenerated

* Adds java test of fix
This commit is contained in:
Justin Black
2022-07-13 18:17:33 -07:00
committed by GitHub
parent 5aa0e0a456
commit c44fe8a04a
40 changed files with 224 additions and 155 deletions

View File

@@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional]
**PetType** | **string** | | [default to PetTypeEnum.ChildCat]
**PetType** | **string** | | [optional] [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

@@ -53,8 +53,8 @@ namespace Org.OpenAPITools.Model
/// Gets or Sets PetType
/// </summary>
[DataMember(Name = "pet_type", IsRequired = true, EmitDefaultValue = false)]
public PetTypeEnum PetType
[DataMember(Name = "pet_type", EmitDefaultValue = false)]
public PetTypeEnum? PetType
{
get{ return _PetType;}
set
@@ -63,7 +63,7 @@ namespace Org.OpenAPITools.Model
_flagPetType = true;
}
}
private PetTypeEnum _PetType;
private PetTypeEnum? _PetType;
private bool _flagPetType;
/// <summary>
@@ -86,10 +86,9 @@ namespace Org.OpenAPITools.Model
/// 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()
/// <param name="petType">petType (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

@@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional]
**PetType** | **string** | | [default to PetTypeEnum.ChildCat]
**PetType** | **string** | | [optional] [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

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

View File

@@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional]
**PetType** | **string** | | [default to PetTypeEnum.ChildCat]
**PetType** | **string** | | [optional] [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
/// <summary>
/// Gets or Sets PetType
/// </summary>
[DataMember(Name = "pet_type", IsRequired = true, EmitDefaultValue = false)]
public PetTypeEnum PetType { get; set; }
[DataMember(Name = "pet_type", EmitDefaultValue = false)]
public PetTypeEnum? PetType { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="ChildCat" /> class.
/// </summary>
@@ -66,11 +66,11 @@ namespace Org.OpenAPITools.Model
/// 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()
/// <param name="petType">petType (default to PetTypeEnum.ChildCat).</param>
public ChildCat(string name = default(string), PetTypeEnum? petType = PetTypeEnum.ChildCat) : base()
{
this.PetType = petType;
this.Name = name;
this.PetType = petType;
this.AdditionalProperties = new Dictionary<string, object>();
}

View File

@@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional]
**PetType** | **string** | | [default to PetTypeEnum.ChildCat]
**PetType** | **string** | | [optional] [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
/// <summary>
/// Gets or Sets PetType
/// </summary>
[DataMember(Name = "pet_type", IsRequired = true, EmitDefaultValue = false)]
public PetTypeEnum PetType { get; set; }
[DataMember(Name = "pet_type", EmitDefaultValue = false)]
public PetTypeEnum? PetType { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="ChildCat" /> class.
/// </summary>
@@ -66,11 +66,11 @@ namespace Org.OpenAPITools.Model
/// 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()
/// <param name="petType">petType (default to PetTypeEnum.ChildCat).</param>
public ChildCat(string name = default(string), PetTypeEnum? petType = PetTypeEnum.ChildCat) : base()
{
this.PetType = petType;
this.Name = name;
this.PetType = petType;
this.AdditionalProperties = new Dictionary<string, object>();
}

View File

@@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional]
**PetType** | **string** | | [default to PetTypeEnum.ChildCat]
**PetType** | **string** | | [optional] [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
/// <summary>
/// Gets or Sets PetType
/// </summary>
[DataMember(Name = "pet_type", IsRequired = true, EmitDefaultValue = false)]
public PetTypeEnum PetType { get; set; }
[DataMember(Name = "pet_type", EmitDefaultValue = false)]
public PetTypeEnum? PetType { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="ChildCat" /> class.
/// </summary>
@@ -66,11 +66,11 @@ namespace Org.OpenAPITools.Model
/// 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()
/// <param name="petType">petType (default to PetTypeEnum.ChildCat).</param>
public ChildCat(string name = default(string), PetTypeEnum? petType = PetTypeEnum.ChildCat) : base()
{
this.PetType = petType;
this.Name = name;
this.PetType = petType;
this.AdditionalProperties = new Dictionary<string, object>();
}

View File

@@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional]
**PetType** | **string** | | [default to PetTypeEnum.ChildCat]
**PetType** | **string** | | [optional] [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
/// <summary>
/// Gets or Sets PetType
/// </summary>
[DataMember(Name = "pet_type", IsRequired = true, EmitDefaultValue = false)]
public PetTypeEnum PetType { get; set; }
[DataMember(Name = "pet_type", EmitDefaultValue = false)]
public PetTypeEnum? PetType { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="ChildCat" /> class.
/// </summary>
@@ -63,11 +63,11 @@ namespace Org.OpenAPITools.Model
/// 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()
/// <param name="petType">petType (default to PetTypeEnum.ChildCat).</param>
public ChildCat(string name = default(string), PetTypeEnum? petType = PetTypeEnum.ChildCat) : base()
{
this.PetType = petType;
this.Name = name;
this.PetType = petType;
}
/// <summary>