[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

@@ -45,6 +45,7 @@ namespace Org.OpenAPITools.Model
this.ShapeOrNull = shapeOrNull;
this.NullableShape = nullableShape;
this.Shapes = shapes;
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
@@ -71,6 +72,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>
@@ -84,6 +91,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();
}
@@ -142,6 +150,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

@@ -61,6 +61,7 @@ namespace Org.OpenAPITools.Model
this.ObjectNullableProp = objectNullableProp;
this.ObjectAndItemsNullableProp = objectAndItemsNullableProp;
this.ObjectItemsNullable = objectItemsNullable;
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
@@ -136,6 +137,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>
@@ -157,6 +164,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();
}
@@ -247,6 +255,10 @@ namespace Org.OpenAPITools.Model
{
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
}
if (this.AdditionalProperties != null)
{
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
}
return hashCode;
}
}