swagger-api / swagger-api/swagger-codegen
Constructor without parameters in generated C# api classes
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
I'm using swagger generated C# api classes to access some api and I discovered that all of it has not constructor without params, but there is constructor with single optional Configuration parameter. Is there some reason for it? May be it makes sense to add it to template? So that feature will make generated api classes corresponding new() generic type constraint (that exactly my case).
Swagger-codegen version
2.3.1
Suggest a fix/enhancement
Add constructor without parameters in api.mustache C# template, behavior will be same with constructor with single optional Configuration parameter where it equals to null.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the C# api.mustache template and inspect the existing constructor that accepts an optional Configuration parameter. Update the template so generated API classes also support construction without parameters, with behavior equivalent to a null Configuration; verify the generated classes satisfy the new() constraint.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100