Byron / google-apis-rs

A binding and CLI generator for all Google APIs
http://byron.github.io/google-apis-rs
Other
1.01k stars 131 forks source link

Improve handling of plurals in generator. #396

Closed fiadliel closed 1 year ago

fiadliel commented 1 year ago

The generator tries to turn plural into singular nouns. However, some words turn out badly, including:

By using a library, we can get a slightly better outcome. I've added an exception for "Data", because seeing that turned into "Datum" is a bit jarring.

For the above, the resulting generated word:

Byron commented 1 year ago

Thanks a lot, a small but very impactful changes particularly for the books1 API !

This looks like a breaking change but I think can be part of the next releases as most of the crates have not yet been republished under the new version. In other words, another major version upgrade won't be needed.

fiadliel commented 1 year ago

Thanks for looking! Yeah I came across Addresse, and it annoyed me 😄 In general, it feels most understandable here if either everything (except data) is converted to the correct singular noun, or nothing is.