Skip to content
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

String-based-enums comparers have to be case insensitive #533

Closed
pakrym opened this issue Mar 12, 2020 · 4 comments · Fixed by #633
Closed

String-based-enums comparers have to be case insensitive #533

pakrym opened this issue Mar 12, 2020 · 4 comments · Fixed by #633
Labels
v3 Version 3 of AutoRest C# generator.

Comments

@pakrym
Copy link
Contributor

pakrym commented Mar 12, 2020

To be consistent with normal enum converters.

@MiYanni MiYanni added the v3 Version 3 of AutoRest C# generator. label Mar 13, 2020
@heaths
Copy link
Member

heaths commented Apr 20, 2020

When you say "normal enum converters", what do you mean? Enum.Parse itself is case-sensitive, which is why we chose the recommendation to be case-sensitive at https://azure.github.io/azure-sdk/dotnet_implementation.html#dotnet-enums. If you're changing the recommendation, we need to do so meaningfully and consistently.

@heaths heaths reopened this Apr 20, 2020
@pakrym
Copy link
Contributor Author

pakrym commented Apr 20, 2020

When you say "normal enum converters", what do you mean?

I mean generated enum converters - https://github.com/Azure/autorest.csharp/blob/feature/v3/test/TestServerProjects/body-string/Generated/Models/Colors.Serialization.cs#L24

As I've said before guidelines do not seem mandate any casing requirements they just provide a sample implementation.

This is something that is service specific but considering that code generator intends to cover as much services as possible and a lot of them send enum values in different cases we've opted for a more relaxed implementation.

@heaths
Copy link
Member

heaths commented Apr 20, 2020

I'm not disagreeing with why the change was made, but then we should update the guidelines to match. You talk a lot about consistency, so I'm advocating that we be consistent. Or at least update the guidelines with basically what you're saying: evaluate on a case-by-case basis. My concern is that, lately, we are ignoring quite a few guidelines with regard to the generator (e.g. collection properties).

@pakrym
Copy link
Contributor Author

pakrym commented Apr 20, 2020

Azure/azure-sdk#1251

@pakrym pakrym closed this as completed Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v3 Version 3 of AutoRest C# generator.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants