Skip to content

Document standard $top/$skip parameters for ARM subscription list operations#4601

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/docs-add-standard-top-skip-parameters
Draft

Document standard $top/$skip parameters for ARM subscription list operations#4601
Copilot wants to merge 2 commits into
mainfrom
copilot/docs-add-standard-top-skip-parameters

Conversation

Copilot AI commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

ARM docs described the reusable pagination parameter models, but did not show how to apply them to ArmListBySubscription via the Parameters template argument. This left a common authoring path undocumented and encouraged hand-rolled query models.

  • What changed

    • Added focused guidance to the ARM resource operations how-to for subscription-scoped list operations.
    • Documented the canonical pattern for wiring standard pagination parameters through Parameters instead of defining raw @query("$top") / @query("$skip") properties.
  • Documented parameter options

    • ARM-native reusable parameters:
      • ArmTopParameter & ArmSkipParameter
    • Azure Core reusable list model:
      • Azure.Core.StandardListQueryParameters
  • Example

    @armResourceOperations
    interface Employees {
      listBySubscription is ArmListBySubscription<
        Employee,
        Parameters = ArmTopParameter & ArmSkipParameter
      >;
    }
    @armResourceOperations
    interface Employees {
      listBySubscription is ArmListBySubscription<
        Employee,
        Parameters = Azure.Core.StandardListQueryParameters
      >;
    }

Co-authored-by: haolingdong-msft <87355844+haolingdong-msft@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service Bot added the meta:website TypeSpec.io updates label Jun 10, 2026
Copilot AI changed the title [WIP] Document adding standard $top/$skip query parameters to ARM list operations Document standard $top/$skip parameters for ARM subscription list operations Jun 10, 2026
Copilot AI requested a review from haolingdong-msft June 10, 2026 08:52
}
```

If you prefer the Azure Core reusable model, you can also pass `Azure.Core.StandardListQueryParameters`:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These don't actually inject the $top and $skip` names, so it's preferred these are not used for ARM.

: https://github.com/Azure/typespec-azure/blob/main/packages/typespec-azure-core/lib/models.tsp#L62-L74

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Mark for the comment.I saw the code of Azure.Core.StandardListQueryParameters has $top and $skip parameters. https://github.com/Azure/typespec-azure/blob/main/packages/typespec-azure-core/lib/models.tsp#L120-L124
Do I misunderstand anything?

@doc("Provides the most common query parameters for list operations.")
model StandardListQueryParameters {
  ...TopQueryParameter;
  ...SkipQueryParameter;
  ...MaxPageSizeQueryParameter;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also noticed there are a few other standard query parameters already defined in the code. Do you have any thoughts on how we should guide users to use them?
https://github.com/Azure/typespec-azure/blob/main/packages/typespec-azure-core/lib/models.tsp#L93-L117

I’m wondering if we should include all of the standard query parameters, or maybe just highlight the most common ones. Curious what you think here.

Employee,
Parameters = Azure.Core.StandardListQueryParameters
>;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

meta:website TypeSpec.io updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeSpec Authoring Docs: cover adding standard $top/$skip query parameters to ARM list operations

3 participants