googleapis / googleapis/google-cloud-node
Make the generator always generate legacy and multi path templates
- Dominant language
- TypeScript
- Stars
- 3.2k
- Forks
- 712
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 99
Description
Context: https://github.com/googleapis/google-cloud-node/issues/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.
Contributor guide
Assessment
This issue has not been assessed yet.