Skip to content

[Azure Mgmt Generator] support legacy operation's ListSinglePage operation #54518

@ArcturusZhang

Description

@ArcturusZhang

Some operation is not technically pageable but we should generate them as pageable, ListSinglePage is one of them.
Real case: https://github.com/Azure/azure-rest-api-specs/blob/b971916ccce7a87579348051c9cef6433ff40a82/specification/attestation/resource-manager/Microsoft.Attestation/Attestation/AttestationProvider.tsp#L91

one of the solution for this is that, when we see an operation has a kind of list, we make it pageable anyway.

Considering it would be so complicated to make an operation pageable in the generator and in some cases it might be problematic, therefore we are relying on the @markAsPageable decorator in TCGC to do this.
In our generator, we will detect list resource operations, and assert they are pageable, otherwise we give diagnostic errors to give hints to our customers that they should add this decorator to solve this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CodeGenIssues that relate to code generationMgmtThis issue is related to a management package.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions