[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:
William Cheng
2023-08-05 13:32:43 +08:00
committed by GitHub
parent c080660cc1
commit f6fb83878b
142 changed files with 2965 additions and 332 deletions

View File

@@ -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;
}
}

View File

@@ -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;
}
}