Byron / google-apis-rs

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

Add support for Spanner #484

Closed IvanUkhov closed 3 months ago

IvanUkhov commented 3 months ago

Hello again,

As mentioned, I am planning to work on Spanner. It is currently in the blacklist, and removing it from there shows that the first problem is duplicate type definitions. I have looked closer, and it is due to concatenation of path segments and singularization. There are distinct entries in the API that after processing this way become indistinguishable, causing the failure.

Here is the naming code involved:

https://github.com/Byron/google-apis-rs/blob/main/src/generator/lib/util.py#L1062

Before I do anything, I would like to ask you what would be the best strategy to proceed. Intuitively, I suspect that many APIs are blacklisted due to this conversion. Ideally, it should be such that it does not lead to ambiguity when the dots are removed. Here are some ideas:

Both will break the current interface. One would have to do bump the major version. Do you have other ideas?

Thank you!

Byron commented 3 months ago

Thanks for reporting. Would it be possible to keep a global list of used type names, and detect clashes that way to disambiguate when needed? If the type-name is generated once and then reused, this could be trivial.

Otherwise, breaking the current API by changing the naming rules would be a last resort.

IvanUkhov commented 3 months ago

That sounds good. I will then do as you suggested.