[REQ] [csharp],[csharp-netcore] Add Parameter Less Default Constructors For Model Classes
Created by: GauravQ
I've been using openapi-generator-cli for generating APIClient Nugets to be used in .Net Framework, .Net Core Web Apps.
But I'm not able to use generated models as parameter in a [Post] Action methods as default conversion from Post Body (JSON) to Class Object requires a parameter less constructor (a default constructor). But the generated models only have a parameterized constructor, which then results in an error.
Probable solution
Adding a default constructor in all Model classes will be very helpful.
As of now the only solution is to create similar Model classes in Web App itself and when calling an API convert that Web App's Model To APIClient's Model (generated model).
Here's how its being generated using v4.3.1
And here's how it could be generated to resolve the issue. having a default constructor with another parameterized constructor
Not sure how much work is needed here, but i would really appreciate if we can have this added.