Closed ackginger closed 2 years ago
I can't figure out a way to specify this in an OpenApi schema, but would really like the generated C# code for AdditionalProperties to go from this:
private System.Collections.Generic.IDictionary<string, object> _additionalProperties = new System.Collections.Generic.Dictionary<string, object>(); [System.Text.Json.Serialization.JsonExtensionData] public System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get { return _additionalProperties; } set { _additionalProperties = value; } }
to this:
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties = default!; [System.Text.Json.Serialization.JsonExtensionData] public System.Collections.Generic.IDictionary<string, object>? AdditionalProperties { get { return _additionalProperties; } set { _additionalProperties = value; } }
Specifically to stop masses of unnecessary allocations when there are no additional properties. Would you accept an MR for this as an opt in feature?
I can't figure out a way to specify this in an OpenApi schema, but would really like the generated C# code for AdditionalProperties to go from this:
to this:
Specifically to stop masses of unnecessary allocations when there are no additional properties. Would you accept an MR for this as an opt in feature?