You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pull request PR googleapis/google-cloud-node-core#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.
Investigate Variables: Analyze the api object 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 (yielding storage-control) and remains correct for other libraries.
Pull request PR googleapis/google-cloud-node-core#885 introduced a hardcoded special case for the
google-storage-controllibrary to fix its documentation link in the generatedREADME.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
apiobject that correctly represents the product's documentation slug (e.g.,storage-controlinstead ofgoogle-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.njkAction Items
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).google-storage-control(yieldingstorage-control) and remains correct for other libraries.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… google-cloud-node-core#885.