Skip to content

mark-as-pageable-ineffective

Id
@azure-tools/typespec-client-generator-core/mark-as-pageable-ineffective

Severity: warning

This diagnostic is issued when @markAsPageable is applied to an operation that is already marked pageable with @list.

  • Area: Pageable SDK metadata. Generation continues using the existing @list paging metadata while the redundant legacy marker has no effect.
  • Not affected: Page item and next-link metadata already discovered from the operation remain unchanged.
model Employee is TrackedResource<EmployeeProperties> {
...ResourceNameParameter<Employee>;
}
model EmployeeProperties {
salary: int32;
}
@armResourceOperations
interface Employees {
get is ArmResourceRead<Employee>;
@markAsPageable("csharp") // operation is already pageable via `ArmResourceListByParent`
listEmployees is ArmResourceListByParent<Employee>;
}

TCGC reports:

@markAsPageable decorator is ineffective since this operation is already marked as pageable with @list decorator. Please remove the @markAsPageable decorator.

Remove @markAsPageable and keep the existing @list pageable metadata.

model Employee is TrackedResource<EmployeeProperties> {
...ResourceNameParameter<Employee>;
}
model EmployeeProperties {
salary: int32;
}
@armResourceOperations
interface Employees {
get is ArmResourceRead<Employee>;
listEmployees is ArmResourceListByParent<Employee>;
}

This diagnostic should not be suppressed. Remove the redundant @markAsPageable, or fix the operation so the marker is needed.