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

Preview ServiceVersions should use PascalCase #24152

Closed
heaths opened this issue Sep 21, 2021 · 2 comments
Closed

Preview ServiceVersions should use PascalCase #24152

heaths opened this issue Sep 21, 2021 · 2 comments
Labels
Client This issue points to a problem in the data-plane of the library. DPG Synapse

Comments

@heaths
Copy link
Member

heaths commented Sep 21, 2021

Based on .NET guidelines for capitalization, preview ServiceVersion values should be PascalCase, e.g. "V2021_09_21_Preview" instead of "V2021_09_21_preview". This violates the AZC0016 analyzer recently added to catch cases like this.

At this time, this is caused by a generator bug but, even when fixed, you should consider whether this introduces an undesirable breaking change. For example, if you've already shipped to customers but haven't changed the preview version, you may want to keep it by redefining the same class outside the "Generated" folder.

The easiest way is to move the entire options class that defines your ServiceVersion to the project folder outside the "Generated" folder and next to your client class. When the code is generated again, this class will not be re-generated and you fully own all updates. This is often desirable when you have to maintain multiple versions as well, such as after you ship your first GA and want to ship another preview of GA, or even if you support multiple previews.

If you are able to rename the value to use the uppercase "_Preview" suffix, please remove the GlobalSuppressions.cs file added to your project in PR #23793.

@heaths heaths added Client This issue points to a problem in the data-plane of the library. Synapse labels Sep 21, 2021
@heaths
Copy link
Member Author

heaths commented Sep 21, 2021

If you haven't shipped, renaming the property in a non-generated source file as described in the issue is best; however, if you have shipped, see #23793 (review) for a good suggestion to define additional members and hide the old ones. These preview ServiceVersions should be deleted once you GA anyway, so you would not have to support them forever

@annelo-msft annelo-msft added the DPG label Jun 1, 2022
@pallavit
Copy link
Contributor

@github-actions github-actions bot locked and limited conversation to collaborators Mar 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. DPG Synapse
Projects
None yet
Development

No branches or pull requests

3 participants