openapi-generator icon indicating copy to clipboard operation
openapi-generator copied to clipboard

[REQ] [csharp-netcore] Support `targetFramework` `net48`

Open johnthagen opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe.

Currently the latest .NET Framework release that is supported by the csharp-netcore generator is net47:

  • https://openapi-generator.tech/docs/generators/csharp-netcore#config-options

For those of us stuck on .NET Framework (for reasons outside our control), it would be great to be able to target the latest .NET Framework 4.8.

Describe the solution you'd like

Accept:

npx @openapitools/openapi-generator-cli generate --generator-name csharp-netcore targetFramework=net48 ...

And in the generated .csproj:

<TargetFramework>net48</TargetFramework>

I haven't found any issues running the generated code under .NET Framework 4.8 when I change the output manually.

Additional context

I've found in practice that the legacy csharp generator is not as well maintained or quickly updated as csharp-netcore, so I've preferred to use csharp-netcore even for .NET Framework 4.8 applications.

johnthagen avatar Sep 20 '22 12:09 johnthagen

yup, we can support that.

how urgent do you need it? would have time to contribute a PR?

wing328 avatar Sep 21 '22 02:09 wing328

how urgent do you need it?

It's not super urgent as we can pretty easily manually change the <TargetFramework> after generation. It was more that .NET Framework 4.8 is the final (and thus super LTS) version of .NET Framework that will be around for years as it continues to hang on, and new users would probably expect to be using that version of .NET Framework if they are still stuck on it.

would have time to contribute a PR?

I haven't contributed much to openapi-generator before, so I'm not sure if I'll have time to make a PR myself.

johnthagen avatar Sep 21 '22 11:09 johnthagen

UPDATE: I've filed https://github.com/OpenAPITools/openapi-generator/pull/13504 to add .net framework 4.8.

wing328 avatar Sep 23 '22 00:09 wing328

@wing328 Thanks! ❤️

johnthagen avatar Sep 25 '22 18:09 johnthagen