googleapis / disco-to-proto3-converter

Apache License 2.0
11 stars 11 forks source link

fix: prevent name collisions between messages and services #107

Closed vchudnov-g closed 11 months ago

vchudnov-g commented 11 months ago

Previously, a Discovery schema and a resource that differed only in casing would result in a proto message and service, respectively, with the same upper-camel-case name in the same namespace. This would cause downstream problems when attempting to parse the proto.

We now disambiguate such cases by suffixing the names of such conflicting services with Service.

We explicitly do NOT deal with recursive disambiguation. That is, if the first disambiguation attempt between a message and a service fails, we do not attempt to find a different suffix to continue the disambiguation. If needed, we can add this later, but for the moment it seems a good idea to flag such occurrences.