Good Morning,
I'm having difficulty with nullable: false not generating correctly. From everything I can see it is correct. I am wondering if this is applicable to my scenario.
https://community.smartbear.com/t5/SwaggerHub/json-schema-validation-of-null-values/m-p/186450#M861
Here is the relevant snippet:
isWithdrawalPaused: type: boolean nullable: false
Which produces:
[DataMember(Name="isWithdrawalPaused")] public bool? IsWithdrawalPaused { get; set; }
For those not familiar with c# the bool? is a nullable and I want bool.
I don't know where the breakdown is and so perhaps it is the engine we are using to interpret the swagger into C#?
swagger-codegen-cli-2.3.0.jar
Any suggestions would be greatly appreciated.
TIA
Hi @ramjet69,
Currently, the C# generator always handles required properties as non-nullable and optional properties as nullable. There's an open issue to improve the nullable logic:
https://github.com/swagger-api/swagger-codegen/issues/2885
Subject | Author | Latest Post |
---|---|---|