mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-03 00:43:46 +00:00
[Default] update isAdditionalPropertiesTrue tag to cover more types (#16227)
* enhance additional properties support * update samples * update tests * add more tests * update samples * fix samples
This commit is contained in:
@@ -43,6 +43,7 @@ namespace Org.OpenAPITools.Model
|
||||
this.ShapeOrNull = shapeOrNull;
|
||||
this.NullableShape = nullableShape;
|
||||
this.Shapes = shapes;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -69,6 +70,12 @@ namespace Org.OpenAPITools.Model
|
||||
[DataMember(Name = "shapes", EmitDefaultValue = false)]
|
||||
public List<Shape> Shapes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
@@ -82,6 +89,7 @@ namespace Org.OpenAPITools.Model
|
||||
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
||||
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
||||
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
@@ -137,7 +145,8 @@ namespace Org.OpenAPITools.Model
|
||||
this.Shapes != null &&
|
||||
input.Shapes != null &&
|
||||
this.Shapes.SequenceEqual(input.Shapes)
|
||||
);
|
||||
)
|
||||
&& (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -165,6 +174,10 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Shapes.GetHashCode();
|
||||
}
|
||||
if (this.AdditionalProperties != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,6 +59,7 @@ namespace Org.OpenAPITools.Model
|
||||
this.ObjectNullableProp = objectNullableProp;
|
||||
this.ObjectAndItemsNullableProp = objectAndItemsNullableProp;
|
||||
this.ObjectItemsNullable = objectItemsNullable;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -134,6 +135,12 @@ namespace Org.OpenAPITools.Model
|
||||
[DataMember(Name = "object_items_nullable", EmitDefaultValue = false)]
|
||||
public Dictionary<string, Object> ObjectItemsNullable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
@@ -155,6 +162,7 @@ namespace Org.OpenAPITools.Model
|
||||
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
|
||||
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
|
||||
sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
@@ -255,7 +263,8 @@ namespace Org.OpenAPITools.Model
|
||||
this.ObjectItemsNullable != null &&
|
||||
input.ObjectItemsNullable != null &&
|
||||
this.ObjectItemsNullable.SequenceEqual(input.ObjectItemsNullable)
|
||||
);
|
||||
)
|
||||
&& (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -315,6 +324,10 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
|
||||
}
|
||||
if (this.AdditionalProperties != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user