Is there a way to change the settings in NSwagStudio so that when the JSON serialization setting outputs as Newtonsoft.Json.Required.AllowNull instead of Newtonsoft.Json.Required.Always?
I currently have the property manually changed to allow for nulls.
[Newtonsoft.Json.JsonProperty("returnCode", Required = Newtonsoft.Json.Required.Always)]
public int ReturnCode { get; set; }
And I need it to be:
[Newtonsoft.Json.JsonProperty("returnCode", Required = Newtonsoft.Json.Required.AllowNull)]
public int ReturnCode { get; set; }
It will not be nullable inside the generated code if it is not nullable at the API-spec
API spec example:
ReturnCode:
type: integer
nullable: true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With