-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[csharp] Move nullable reference types switch to abstract #9661
[csharp] Move nullable reference types switch to abstract #9661
Conversation
@devhl-labs thanks for the PR as always. Do we also need to update the mustache templates to actually use the option (the mustache tag)? In other words, if we move the option to the C# abstract class, we need to make sure all C# generators that inherit the abstract generator properly support the option. Otherwise, we can only add the option to individual generators to start with. |
Yes, it would have to be handled by each set of template files. If we don't put it in the abstract, then we are removing the option for users to use their own custom templates to handle this option for generators that don't support it yet. We would also be adding more work for users who want to do a PR to add the feature to mustache files. #9643 But if you really want each generator to implement it individually, please tell me. |
I think that, technically, there is no need to actually change any part of the templates aside from the csproj files to use this. The reason is that with nullable reference types you simply change the post process function to treat every type as nullable and voila you get a nullable reference annotation for each type that is optional |
I can add it to the csproj files later today. |
Yes, that what I meant, e.g. https://github.com/OpenAPITools/openapi-generator/pull/9620/files#diff-b62dd64c4e02abc058c477127e8c9c85250c66b616d6683c9ee143470bcf2cd9R10 |
Im tracking i just didnt get to it today. |
Aspnetcore was already handled. Skipped dotnet-core2 because it's deprecated. Skipped nancyfx because the framework itself is deprecated as far as I can tell. Added to csharp-netcore. I'm guessing the checks just need to be restarted after the docker rate limit is over. |
Can you please resolve the merge conflicts when you've time? |
Done |
I see drone had an unrelated error. Is that why app veyor failed? |
AppVeyor tests passed via https://ci.appveyor.com/project/WilliamCheng/openapi-generator/builds/39524940 |
Moving the nullable reference types switch from aspnet generator to abstract so all csharp can use it.
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.For Windows users, please run the script in Git BASH.
master
,5.1.x
,6.0.x
@mandrean @frankyjuang @shibayan @Blackclaws @wing328