Open marcobudde opened 1 year ago
We are using NSwagStudio 13.18.2 to generate a C# client for our backend.
One of our data types contains a property called "System":
"PositionMatched": { "type": "object", "additionalProperties": false, "required": [ "System", "X", "Y", "Z" ], "properties": { "System": { "type": "boolean", "nullable": true }, "X": { "type": "boolean", "nullable": true }, "Y": { "type": "boolean", "nullable": true }, "Z": { "type": "boolean", "nullable": true } } },
This results into a conflict with the "System" namespace of the generated JsonIgnore statement:
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class PositionMatched { [System.Text.Json.Serialization.JsonPropertyName("System ")] [System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.Never)] public bool? System { get; set; }
As the generated code already contains the following statement:
using System = global::System;
it would be better to reference the System namespace within the generated code with
System::Text.Json.Serialization.JsonIgnoreCondition.Never
instead of
System.Text.Json.Serialization.JsonIgnoreCondition.Never
I'm running into this as well.
Hello, faced with it on 13.20.0
We are using NSwagStudio 13.18.2 to generate a C# client for our backend.
One of our data types contains a property called "System":
This results into a conflict with the "System" namespace of the generated JsonIgnore statement:
As the generated code already contains the following statement:
using System = global::System;
it would be better to reference the System namespace within the generated code with
System::Text.Json.Serialization.JsonIgnoreCondition.Never
instead of
System.Text.Json.Serialization.JsonIgnoreCondition.Never