This rule requires certain standard fields on declarative-friendly resources,
as mandated in [AIP-148][].
Details
This rule looks at any resource with a google.api.resource annotation that
includes style: DECLARATIVE_FRIENDLY, and complains if it does not include
all of the following fields:
string path
string uid
string display_name
google.protobuf.Timestamp create_time
google.protobuf.Timestamp update_time
google.protobuf.Timestamp delete_time
Examples
Incorrect code for this rule:
Correct code for this rule:
Disabling
If you need to violate this rule, use a leading comment above the message.
Remember to also include an aep.dev/not-precedent comment explaining why.
If you need to violate this rule for an entire file, place the comment at the
top of the file.
Standard resource fields- Field behavior
Standard resource fields: Field behavior
This rule enforces that all standard resource fields have the correct
google.api.field_behavior, as mandated in [AIP-148][].
Details
This rule looks at any message with a google.api.resource annotation, and
complains if any of the following fields does not have a
google.api.field_behavior annotation with a value of OUTPUT_ONLY:
create_time
delete_time
uid
update_time
Examples
Incorrect code for this rule:
Correct code for this rule:
Disabling
If you need to violate this rule, use a leading comment above the field.
Remember to also include an aep.dev/not-precedent comment explaining why.
If you need to violate this rule for an entire file, place the comment at the
top of the file.
Human names
Human names
This rule encourages terms for human names (given_name and family_name)
that are more accurate across cultures, as mandated in [AIP-148][].
Details
This rule looks for fields named first_name and last_name, and complains if
it finds them, suggesting the use of given_name and family_name
(respectively) instead.
Examples
Incorrect code for this rule:
Correct code for this rule:
Disabling
If you need to violate this rule, use a leading comment above the field or its
enclosing message. Remember to also include an aep.dev/not-precedent
comment explaining why.
If you need to violate this rule for an entire file, place the comment at the
top of the file.
IP Address field format annotation
IP Address field format annotation
This rule encourages the use of one of the IP Address format annotations,
IPV4, IPV6, or IPV4_OR_IPV6, on the ip_address field or a field ending
with _ip_address, as mandated in [AIP-148][].
Details
This rule looks on for fields named ip_address or ending with _ip_address
and complains if it does not have the (google.api.field_info).format
annotation with one of IPV4, IPV6, or IPV4_OR_IPV6, or has a format other
than than one of those.
Examples
Incorrect code for this rule:
Correct code for this rule:
Disabling
If you need to violate this rule, use a leading comment above the field or its
enclosing message. Remember to also include an aep.dev/not-precedent
comment explaining why.
If you need to violate this rule for an entire file, place the comment at the
top of the file.
uid format annotation
uid format annotation
This rule encourages the use of the UUID4 format annotation on the uid
field, as mandated in [AIP-148][].
Details
This rule looks on for fields named uid and complains if it does not have the
(google.api.field_info).format = UUID4 annotation or has a format other than
UUID4.
Examples
Incorrect code for this rule:
Correct code for this rule:
Disabling
If you need to violate this rule, use a leading comment above the field or its
enclosing message. Remember to also include an aep.dev/not-precedent
comment explaining why.
If you need to violate this rule for an entire file, place the comment at the
top of the file.