Generated path templates should include all valid patterns for child_type resource references #570
Labels
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
In #488, we noticed that no path template exists for
projects/{project}/locations/{location}
, even though this is a valid input for the parent field on DLP API calls.Based on https://google.aip.dev/122 and https://google.aip.dev/123, it seems like a path template should have been generated for the DLP API.
What I'd naively expect to happen, is that given the following in the DLP proto:
I would end up with the following NodeJS path templates:
As far as I can tell, this conforms with the API guidance linked above, and it seems like this should result in usable path templates for all of the valid forms of parent. However, we don't see all the templates described above. (Current set of generated path templates)
As the current logic was explained to me, path templates are only generated if they are directly referenced in a resource. Since this doesn't happen (and there's no reason in the API definition that it needs to happen), no path templates are generated. The existing projectPathTemplate that does exist occurs because many of our APIs (like CreateDlpJob) annotate with
(google.api.resource_reference) = { type: "cloudresourcemanager.googleapis.com/Project"
, which is the kind of direct reference that the current generation logic is looking for.Request:
Should the client generation code create templates for all of the patterns in the message being used in a
(google.api.resource_reference).child_type
annotation? (With the last segment trimmed, of course).Or, as put by @alexander-fenster :
The text was updated successfully, but these errors were encountered: