Closed Mrks83 closed 3 months ago
I had the exact same issue when I updated from NSwag 14.0.3 to 14.0.04. I didn't understand why I had a "new" property in my client.
Using JsonIgnore
attribute from System.Text.Json.Serialization
fix that.
Thanks !
I think this PR here broke this: https://github.com/RicoSuter/NSwag/pull/4733
I'musing openApiToCSharpClient (nswag 14.0.7 version) prior to that i was using (nswag 13.20.0 version) before my client code was showing jsonignore attributes like :
[System.Text.Json.Serialization.JsonPropertyName("href")]
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.Never)]
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
public System.Uri Href { get; set; }
Now its not showing
[System.Text.Json.Serialization.JsonPropertyName("href")] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public System.Uri Href { get; set; }
what do i need to do in-order to fix it?
With NSwag 14.0.3 public properties with
[JsonIgnore]
were ignored. Now, they appear in the OpenApi document. It looks like the serializer has changed from Newtonsoft Json to System.Text Json.