Closed IvanUkhov closed 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.
That sounds good. I will then do as you suggested.
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:
Dot
(saw it in some other crate). It will be manyDot
s in types, but it will be unambiguous.Both will break the current interface. One would have to do bump the major version. Do you have other ideas?
Thank you!