Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sofisl opened this issue Apr 29, 2024 · 0 comments
Open

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

sofisl opened this issue Apr 29, 2024 · 0 comments
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@sofisl
Copy link
Contributor

sofisl commented Apr 29, 2024

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:

{{ id.get(template.name.toCamelCase() + "Path") }}(

And the logic is actually set here:

const multiPattern = patterns!.length > 1;

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.

@sofisl sofisl added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Apr 29, 2024
@sofisl sofisl self-assigned this Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

1 participant