googleapis / googleapis/api-linter

AIP-122: The `_name` suffix restriction should only be applied to fields representing a resource

Open
#1,179 0 comments 0 reactions 0 assignees View on GitHub
priority: p2 type: bug
Dominant language
Go
Stars
765
Forks
181
Avg merge
2d 12h
Merged PRs (30d)
3

Description

The following line in the AIP

> Field names **should not** use the `_name` suffix unless the field would be
ambiguous without it (e.g., `crypto_key_name`)

Is under the section "Fields representing another resource". The statement does _not_ apply generally to all fields, only fields that represent a resource. Indeed, there's a note in the same AIP that explicitly suggests using the `_name` suffix for fields that are not resource references:

> **Note:** Fields **must not** be called `name` except for this purpose. For
other use cases, either use a different term or prepend an adjective (for
example: `display_name`).

The current implementation for the `core::0122::name-suffix` rule, and indeed even its [documentation](https://linter.aip.dev/122/name-suffix) incorrectly complains if it sees the `_name` suffix on _any_ field.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.