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

Change the way we get plural resource names #1778

Merged

Conversation

ArcturusZhang
Copy link
Member

@ArcturusZhang ArcturusZhang commented Dec 14, 2021

Description

  1. Change the way we get the plural form of a resource name. Now we use LastWordToPlural() instead which will first split the string into words, and change the last word to its plural form, then concat them back. This will give us more accurate result, such as, we will get the plural form of KeyInformation to be KeyInformation instead of KeyInformations since information is uncountable.
  2. Found a bug in Humanizer that if I call "S".Singularize(), it throws exceptions. Unfortunately our test project has this case. I have to make a work around.

Checklist

To ensure a quick review and merge, please ensure:

  • The PR has a understandable title and description explaining the why and what.
  • The PR is opened in draft if not ready for review yet.
    • If opened in draft, please allocate sufficient time (24 hours) after moving out of draft for review
  • The branch is recent enough to not have merge conflicts upon creation.

Ready to Land?

  • Build is completely green
    • Submissions with test failures require tracking issue and approval of a CODEOWNER
  • At least one +1 review by a CODEOWNER
  • All -1 reviews are confirmed resolved by the reviewer
    • Override/Marking reviews stale must be discussed with CODEOWNERS first

# Conflicts:
#	src/AutoRest.CSharp/Mgmt/Generation/SubscriptionExtensionsWriter.cs
@AlexanderSher
Copy link
Contributor

LGTM

@ArcturusZhang ArcturusZhang merged commit f4594a1 into Azure:feature/v3 Dec 16, 2021
@ArcturusZhang ArcturusZhang deleted the change-the-way-we-get-plural branch December 16, 2021 08:21
archerzz pushed a commit to archerzz/autorest.csharp that referenced this pull request Dec 17, 2021
* change the way we get plural and singular form of resource names

# Conflicts:
#	src/AutoRest.CSharp/Mgmt/Generation/SubscriptionExtensionsWriter.cs

* fix exception and regenerate

* add test cases

* move the ResourceNameToPlural to mgmt namespace

* regenerate

* fix a bug in toSingular

* regenerate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants