AEP-0122 Linter Rules
HTTP URI case
HTTP URI case
This rule enforces that the HTTP URI pattern only uses kebab-case for word separation, as mandated in AEP-122.
Details
This rule scans all methods and ensures that the _
character and no uppercase
letters are present.
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 method. 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.
No self links
No self links
This rule enforces that resource messages do not contain any fields called
string self_link
, as mandated in AEP-122.
Details
This rule complains if it sees a resource field of type string
that is also
named self_link
.
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 method. 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.
Path field suffix
Path field suffix
This rule enforces that fields do not use the suffix _path
, as mandated in
AEP-122.
Details
This rule scans all fields complains if it sees the suffix _path
on a field.
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 method.
If you need to violate this rule for an entire file, place the comment at the top of the file.
Resource pattern collection identifiers
Resource pattern collection identifiers
This rule enforces that messages that have a google.api.resource
annotation
have properly formatted collection identifiers in each pattern
, as described
in AEP-122.
Details
This rule scans messages with a google.api.resource
annotation, and validates
the format of pattern
collection identifiers, specifically that they are in
lowerCamelCase form and must start with a lowercase letter.
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.
If you need to violate this rule for an entire file, place the comment at the top of the file.
Output Only Resource ID fields
Output Only Resource ID fields
This rule enforces that resource ID fields are classified as OUTPUT_ONLY
, as
mandated in AEP-122.
Details
This rule scans all resource fields and complains if it sees an ID field, named
as uid
or with the _id
suffix, that is not classified as OUTPUT_ONLY
.
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.
If you need to violate this rule for an entire file, place the comment at the top of the file.
Resource reference type
Resource reference type
This rule enforces that all fields with the google.api.resource_reference
annotation are strings, as mandated in AEP-122.
Details
This rule complains if it sees a field with a google.api.resource_reference
that has a type other than string
.
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 method. 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.