Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support array response in the template #2301

Open
pshao25 opened this issue Mar 4, 2025 · 1 comment
Open

Support array response in the template #2301

pshao25 opened this issue Mar 4, 2025 · 1 comment
Assignees
Labels
needs-area needs-info Mark an issue that needs reply from the author or it will be closed automatically

Comments

@pshao25
Copy link
Member

pshao25 commented Mar 4, 2025

All the customizable response in the arm template only accepts model. But there are cases whose response is array.

"200": {
  "description": "OK",
  "schema": {
    "type": "array",
    "items": {
      "$ref": "#/definitions/VirtualMachineImageResource"
    }
  }
}

However, if I write this operation like this

listPublishers is ArmProviderActionSync<
  Response = {
    @bodyRoot body: VirtualMachineImageResource[]
  }
>;

The emitted swagger doesn't have x-ms-pageable, which raises ci failure:

x-ms-pageable extension must be specified for LIST APIs.

If I write this operation like this

listPublishers is ComputeProviderActionSync<
    Response = Page<VirtualMachineImageResource>,
  >;

It's actually not correct because Page<> is not an array, which also leads to the mismatch with the existing example data.

@timotheeguerin
Copy link
Member

how is it pageable if it just returns an array, what paging mechanism does it use?

@timotheeguerin timotheeguerin added the needs-info Mark an issue that needs reply from the author or it will be closed automatically label Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-area needs-info Mark an issue that needs reply from the author or it will be closed automatically
Projects
None yet
Development

No branches or pull requests

2 participants