-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
size: sPull request size is small.Pull request size is small.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Pull request PR #885 introduced a hardcoded special case for the google-storage-control library to fix its documentation link in the generated README.md.
Reasoning
Hardcoding specific libraries in the generator templates (api.naming.namePath == 'google-storage-control') is not a scalable or clean solution. It's likely that the generator is currently using a variable (api.naming.nameNotCapitalized) that doesn't accurately represent the documentation path for all products.
A better approach is to identify or introduce a variable in the api object that correctly represents the product's documentation slug (e.g., storage-control instead of google-storage-control) to ensure the links are generated correctly for all libraries without special casing.
Relevant Files
generator/gapic-generator-typescript/templates/cjs/typescript_gapic/README.md.njkgenerator/gapic-generator-typescript/templates/esm/typescript_gapic/README.md.njk
Action Items
- Investigate Variables: Analyze the
apiobject structure used in the templates to find a more suitable variable for the documentation link (e.g., check other naming or product-related fields). - Verify Solution: Ensure the chosen variable works correctly for
google-storage-control(yieldingstorage-control) and remains correct for other libraries. - Remove Hardcoding: Update the
README.md.njktemplates to use the correct variable universally and remove theif/elseblock introduced in PR fix: update README templates to use correct API reference link for st… #885.
Metadata
Metadata
Assignees
Labels
size: sPull request size is small.Pull request size is small.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.