Skip to content

Make the generator always generate legacy and multi path templates #554

@sofisl

Description

@sofisl

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.

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.size: mPull request size is medium.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions