Core rules

Core rules are based on generally-applicable AIPs. They are enabled by default, and should be enabled for most APIs. It is recommended that APIs which do not want to follow certain AIPs within the core section disable those rules individually, rather than disabling the core rules as a set.

Expand all Collapse all

AIP-122

camel-case-uris All resource names must use camel case in collection identifiers.

AIP-126

unspecified All enums must have a default unspecified value.
upper-snake-values All enum values must be in upper snake case.

AIP-127

http-annotation HTTP annotations must be present on non-streaming methods.

AIP-131

http-body Get methods must not have an HTTP body.
http-method Get methods must use the GET HTTP verb.
http-uri-name Get methods must map the name field to the URI.
request-message-name Get methods must have standardized request message names.
request-name-field Get RPCs must have a `name` field in the request.
request-unknown-fields Get RPCs should not have unexpected fields in the request.
response-message-name Get methods must return the resource.
synonyms Get methods must be named starting with "Get".

AIP-132

request-field-types List RPCs should have fields with consistent types.
request-message-name List methods must have standardized request message names.
request-parent-field List RPCs must have a `parent` field in the request.
request-unknown-fields List RPCs should not have unexpected fields in the request.
response-message-name List methods must have standardized response message names.

AIP-133

http-body Create methods must have the HTTP body set to the resource.
http-method Create methods must use the POST HTTP verb.
http-uri-parent Create methods must map the parent field to the URI.
request-message-name Create methods must have standardized request message names.
request-parent-field Create RPCs must have a `parent` field in the request.
request-resource-field Create RPCs must have a field for the resource in the request.
request-unknown-fields Create RPCs should not have unexpected fields in the request.
response-message-name Create methods must return the resource.
synonyms Create methods must be named starting with "Create".

AIP-134

http-body Update methods must have the HTTP body set to the resource.
http-method Update methods must use the PATCH HTTP verb.
http-uri-name Update methods must map the resource's name field to the URI.
request-mask-field Update RPCs must have a field mask in the request.
request-message-name Update methods must have standardized request message names.
request-resource-field Update RPCs must have a field for the resource in the request.
request-unknown-fields Update RPCs should not have unexpected fields in the request.
response-message-name Update methods must return the resource.
synonyms Update methods must be named starting with "Update".

AIP-135

http-body Delete methods must not have an HTTP body.
http-method Delete methods must use the DELETE HTTP verb.
http-uri-name Delete methods must map the name field to the URI.
request-message-name Delete methods must have standardized request message names.
request-name-field Delete RPCs must have a `name` field in the request.
request-unknown-fields Delete RPCs should not have unexpected fields in the request.
response-message-name Delete methods must return Empty or the resource.

AIP-136

http-body Custom methods must have the HTTP body set to `*`.
http-method Custom methods must use the POST or GET HTTP verb.
http-uri-suffix Custom methods should have a correct URI suffix.
prepositions Custom methods must not include prepositions in their names.
verb-noun Custom methods should be named with the verb, then the noun.

AIP-140

abbreviations Field names should use common abbreviations.
base64 Base64 fields should use the `bytes` type.
lower-snake Field names should use `snake_case`.
prepositions Fields must not include prepositions in their names.

AIP-141

count-suffix Quantities should use a `_count` suffix.
forbidden-types Fields should avoid unsigned integer types.

AIP-142

time-field-names Timestamps should use `google.protobuf.Timestamp`.
time-field-type Timestamps should use `google.protobuf.Timestamp`.

AIP-143

standard-codes Fields representing concepts with standardized codes must use them.
string-type Fields representing standardized codes must be strings.

AIP-151

lro-metadata-type LRO methods must have a metadata type.
lro-response-type LRO methods must have a response type.
lro-types-defined-in-file LRO response and metadata messages must be defined in the same file.
operation-info LRO methods must include an `operation_info` annotation.

AIP-158

request-page-size-field Paginated RPCs must have a `page_size` field in the request.
request-page-token-field Paginated RPCs must have a `page_token` field in the request.
response-next-page-token-field Paginated RPCs must have a `next_page_token` field in the response.

AIP-191

filenames Proto files must use reasonable filenames.
proto-version All proto files must use proto3.

AIP-192

has-comments Everything in a proto file must be commented.
only-leading-comments All public comments should be leading comments.

AIP-203

immutable Immutable fields should be annotated.
input-only Input only fields should be annotated.
optional Optional fields may be annotated.
optional-conflict Optional fields must not have any other field behavior.
optional-consistency Optional fields should either be always or never annotated.
output-only Output only fields should be annotated.
required Required fields should be annotated.

AIP-216

synonyms Lifecycle state enums should be called "State", not "Status".

AIP-231

http-body Batch Get methods must not have an HTTP body.
http-method Batch Get methods must use the GET HTTP verb.
http-uri-suffix Batch Get methods must have the correct URI suffix
plural-method-name Batch Get methods must have plural names.
request-message-name Batch Get methods must have standardized request message names.
request-names-field Batch Get RPCs should have a `names` field in the request.
request-parent-field Batch Get RPCs must have a `parent` field in the request.
response-message-name Batch Get methods must have standardized response message names.
response-resource-field Batch Get RPCs must have a repeated field for the resource in the response.

AIP-233

http-body Batch Create methods should use `*` as the HTTP body.
http-method Batch Create methods must use the POST HTTP verb.
http-uri-suffix Batch Create methods must have the correct URI suffix
plural-method-name Batch Create methods must have plural names.
request-message-name Batch Create methods must have standardized request message names.
request-parent-field Batch Create RPCs must have a `parent` field in the request.
request-requests-field Batch Create RPCs should have a `requests` field in the request.
response-message-name Batch Create methods must have standardized response message names.
response-resource-field Batch Create RPCs must have a repeated field for the resource in the response.