Azure / autorest.csharp

Extension for AutoRest (https://github.com/Azure/autorest) that generates C# code
MIT License
142 stars 166 forks source link

DPG generator generates an empty ClientOptions class #3048

Open ShivangiReja opened 1 year ago

ShivangiReja commented 1 year ago

Generator is generating an empty ConfigurationClientOptions class which is not needed as there is a customized ConfigurationClientOptions class available with all the required properties outside of the generated folder.

HLC generated code doesn't generate an empty ClientOptions class if there is a customized class available outside of the generated folder. For example: there is no ClientOptions class generated for TextAnalytics here.

For more details check this PR - https://github.com/Azure/azure-sdk-for-net/pull/33780#discussion_r1092318398

pshao25 commented 1 year ago

In your customization class, you could add [assembly: CodeGenSuppressType("ConfigurationClientOptions")]

ShivangiReja commented 1 year ago

This is just a workaround to not generate any type. If we have a customized type like this and it has all the required properties in it, then I think code gen shouldn't generate an empty ConfigurationClientOptions type without adding CodeGenSuppressType.