And when generating a C# client using the "classStyle": "Record" you get the following
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class Foo
{
[System.Text.Json.Serialization.JsonConstructor]
public Foo(int @number)
{
this.Number = @number;
}
[System.Text.Json.Serialization.JsonPropertyName("number")]
public int Number { get; }
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class Bar : Foo
{
[System.Text.Json.Serialization.JsonConstructor]
public Bar(int @number, int @number)
: base(number)
{
this.Number = @number;
}
[System.Text.Json.Serialization.JsonPropertyName("number")]
public int Number { get; }
}
or with "generateNativeRecords": true
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial record Foo
{
[System.Text.Json.Serialization.JsonConstructor]
public Foo(int @number)
{
this.Number = @number;
}
[System.Text.Json.Serialization.JsonPropertyName("number")]
public int Number { get; init; }
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial record Bar : Foo
{
[System.Text.Json.Serialization.JsonConstructor]
public Bar(int @number, int @number)
: base(number)
{
this.Number = @number;
}
[System.Text.Json.Serialization.JsonPropertyName("number")]
public int Number { get; init; }
}
Both Bar constructors generate with a duplicate "number" parameter
Given the following classes
The following is generated in the swagger document
And when generating a C# client using the "classStyle": "Record" you get the following
or with "generateNativeRecords": true
Both Bar constructors generate with a duplicate "number" parameter