AEP-0158 Linter Rules
Paginated methods- Page size field
Paginated methods: Page size field
This rule enforces that all List
and Search
methods have a
int32 page_size
field in the request message, as mandated in AEP-158.
Details
This rule looks at any message matching List*Request
or Search*Request
and
complains if either the page_size
field is missing, or if it has any type
other than int32
.
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
the page_size
field is missing) or above the field (if it is the wrong type).
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.
Paginated methods- Page token field
Paginated methods: Page token field
This rule enforces that all List
and Search
methods have a
string page_token
field in the request message, as mandated in AEP-158.
Details
This rule looks at any message matching List*Request
or Search*Request
and
complains if either the page_token
field is missing, or if it has any 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 message (if
the page_token
field is missing) or above the field (if it is the wrong type).
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.
Paginated methods- skip field
Paginated methods: skip field
This rule enforces that all List
and Search
request skip
fields have type int32
, as
mandated in AEP-158.
Details
This rule looks at any message matching List*Request
or Search*Request
that
contains a skip
field, and complains if the field is not a singular int32
.
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.
Paginated methods- Next page token field
Paginated methods: Next page token field
This rule enforces that all List
and Search
methods have a
string next_page_token
field in the response message, as mandated in
AEP-158.
Details
This rule looks at any message matching List*Response
or Search*Response
and complains if either the next_page_token
field is missing, or if it has
any 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 message (if
the next_page_token
field is missing) or above the field (if it is the wrong type).
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.
Paginated methods- Page token field
Paginated methods: Page token field
This rule enforces that all List
and Search
methods have a repeatable field
in the response message, as mandated in AEP-158.
Details
This rule looks at any message matching List*Response
or Search*Response
that has next_page_token
field and complains if there does not exist a field that is repeated.
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 or 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.
Paginated methods- Unary responses
Paginated methods: Unary responses
This rule enforces that all paginated methods (List
and Search
methods, or
methods with pagination fields) use unary responses, as mandated in
AEP-158.
Details
This rule looks at any message matching List*Response
or Search*Response
,
or any response message that has next_page_token
field, and complains if the
method uses gRPC server streaming (the stream
keyword).
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 or 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.