collection-response-only-value-and-next-link
@azure-tools/typespec-azure-resource-manager/collection-response-only-value-and-next-linkARM collection GET response models must declare only the value and nextLink properties.
ARM collection GET responses must use a predictable envelope containing exactly value and
nextLink. Additional top-level properties or a missing envelope property make generated clients
and pagination tooling handle list operations inconsistently.
Impact
Section titled “Impact”- Area: API
Collection response envelopes with other shapes violate the ARM RPC contract and can produce inconsistent generated client pagination behavior.
❌ Incorrect
Section titled “❌ Incorrect”model WidgetListResult { value: Widget[]; nextLink?: string; totalCount?: int32;}
@route("/subscriptions/{subscriptionId}/providers/Contoso.Widgets/widgets")@getop listWidgets(@path subscriptionId: string): WidgetListResult;✅ Correct
Section titled “✅ Correct”model WidgetListResult { value: Widget[]; nextLink?: string;}
@route("/subscriptions/{subscriptionId}/providers/Contoso.Widgets/widgets")@getop listWidgets(@path subscriptionId: string): WidgetListResult;LintDiff Equivalent
Section titled “LintDiff Equivalent”This rule corresponds to the Swagger validator rule GetCollectionOnlyHasValueAndNextLink.
Suppression
Section titled “Suppression”Suppress this rule only when compatibility requirements prevent the response envelope from
containing exactly value and nextLink.