Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add guidance to avoid overly generic resource names. #1288

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Jseph
Copy link

@Jseph Jseph commented Dec 20, 2023

These often cause confusion down the line as the API introduces more concepts.

These often cause confusion down the line as the API introduces more concepts.
@Jseph Jseph requested a review from a team as a code owner December 20, 2023 23:33
Note: the date will need to be updated if this is merged.
Fix Typo
Copy link
Collaborator

@noahdietz noahdietz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add a quick blurb in a Rationale sub-section? Something like ### Overly generic type names

aip/general/0123.md Outdated Show resolved Hide resolved
aip/general/0123.md Outdated Show resolved Hide resolved
@noahdietz noahdietz requested review from andrei-scripniciuc and removed request for itsStrobe December 20, 2023 23:48
@Jseph
Copy link
Author

Jseph commented Dec 21, 2023

Added rationale as suggested.

Comment on lines +114 to +120
### Overly Generic Type Names

Overly generic types like `Metadata` or `Resource` will cause confusion as the
API introduces more concepts. Unless the resource represents a
[singleton][aip-156] containing API-level settings, a more specific name should
be used.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In light of the recent guidance to avoid generic resource names,

I recommend providing developers with specific naming conventions for common patterns. For instance, patterns where information is passed as a 'bag' of data, often seen in APIs like:

These patterns typically involve attaching transient(depending of the workflow) data to a resource or tagging for message-passing and webhook consumption. I've encountered this frequently and concur that a standardized terminology would be beneficial. Specifically, distinguishing between two levels of metadata can be crucial:

  • System Metadata: This level is intended for developers and controls system-level workflows. Only programmers should attach data to these objects based on Internal concerns to the service that defined.
  • User-Level Metadata: Allows external clients to append information, enabling control over the flow not just internally but also for client-side processes.

By adopting distinct terms for these levels, we can reduce confusion and enhance the clarity and functionality of our API designs.

I would love to hear your thoughts about the topic and how Google thinks about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants