Open wing328 opened 7 years ago
@wing328 I would disagree that merging the C# 2.0 generator into the others will lead to easier maintenance.
The other generators currently use syntax which is unavailable in C# 2.0 (object initialization, default/named parameters, implicit types). As well, there are additional keywords in later versions which are not keywords in C# 2.0. It's been nearly ten years since I last used C# 2.0, but I seem to recall there were issues with the migration of delegates and enumerations to C# 3.0 (really 3.5 since we don't have a 3.0 generator).
Merging them all will create many unnecessary conditional blocks which I think will become difficult to reason about.
One path I think we could take is to merge the generator code in Java, but keep the templates physically separate. However, this could be a breaking change if anyone currently relies on the existing template structure for custom templates.
@jimschubert fair enough. My goal is to keep the C# 2.0 generator up-to-date with the enhancements, bug fixes we applied to the C# (3.5, 4.5, UWP) generator as I believe C# 2.0 generator is still popular to Unity developers.
@wing328 I agree with your points. I was just trying to say I think it'd be more maintainable as a separate generator that extends the other C# generator. However, if you want them all to be executed via -l csharp
, I don't think my suggestion is possible (easily) with the current code.
Do you think it would make more sense to push most of the bug fixes into the abstract class? I think this would solve most of the issues.
@wing328 I opened a PR to remove a bit of the duplicated code in the C# 2.0 generator in favor of the abstract base class. I explained in the PR why it doesn't consolidate templates, which basically reiterates what I stated above.
Let me know if you have any suggestions about how to merge templates cleanly and in a way that doesn't break current integrations and I'll investigate it further.
Description
Currently, C# (
csharp
) generator supports the following .net framework/standard:and there's a separate generator for C# 2.0.
We want to consolidate/merge C# 2.0 generator into
csharp
generator for easier maintenance and support.Swagger-codegen version
Latest master
If anyone wants to work on the enhancement, please reply to let us know. Thanks!