googleapis / googleapis/api-linter

AIP-122: consider warning if a string looks like it should be a resource reference but has no annotation

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

Description

AIP-122 provides guidance on resource reference format, but it's difficult to identify this field, because resource references can be an arbitrary noun.

Here's an example of a string that should be a resource reference:

```
// The name of the Pub/Sub topic. Format:
// `projects/{PROJECT_ID}/topics/{TOPIC_NAME}`.
string topic = 1;
```

Perhaps we could use a heuristic here to ask the user to double-check if their field should be a resource reference?

Some possible heuristics:

- "name of" in the string, since name should be a resource name most of the time.
- "Format:" with a pathed format following it.

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.