-
Notifications
You must be signed in to change notification settings - Fork 21
Description
Context: googleapis/google-cloud-node#5289
There is a known breaking change in the generator that when an API specifies multiple pattern types, after only having one, the generator only generates paths for the new ones, and not the old ones.
A possible fix is to always generate the legacy naming, even if new patterns are introduced. So, in this example, we'd always generate secretVersionPathTemplate and the new multipattern ones too.
This is where the paths get rendered: https://github.com/googleapis/gapic-generator-typescript/blob/7cfda611b5a668e0f62584b52637ca6f1842d42c/templates/cjs/typescript_gapic/src/%24version/%24service_client.ts.njk#L1008
And the logic is actually set here: https://github.com/googleapis/gapic-generator-typescript/blob/7cfda611b5a668e0f62584b52637ca6f1842d42c/typescript/src/schema/resource-database.ts#L68
We'd need to make sure both branches are executed, i.e., regardless of whether there are multipatterns, we should also generate a legacy pattern as well.