Skip to content

Dataverse: preserve list continuation value for GetItemsAsync pagination #208

Description

@daviburg

Summary

The generated Microsoft Dataverse client exposes GetNextPageAsync(string nextLinkValue), but the GetItemsAsync response model (ItemsList) exposes only value. It does not preserve the opaque continuation/next-link value required by GetNextPageAsync.

This prevents an SDK consumer from implementing the normal list-records paging flow using only the typed public API.

Current generated surface

public class ItemsList
{
    [JsonPropertyName("value")]
    public List<Item> Value { get; set; }
}

public Task<ItemsList> GetItemsAsync(...)
public Task<JsonElement> GetNextPageAsync(string nextLinkValue, ...)

GetItemsAsync supports $apply, $filter, $orderby, $top, and $expand; it has no continuation-token parameter. The generated model also does not contain an explicit next-link property or extension-data dictionary, so an opaque continuation returned by the connector is discarded during deserialization.

Reproduction

  1. Call GetItemsAsync against a Dataverse table that returns more than one page.
  2. Observe that the typed ItemsList result exposes its Value collection only.
  3. There is no token/link available to pass into GetNextPageAsync.

Expected behavior

The generator should preserve the connector continuation value on ItemsList, preferably as a documented typed property when the contract defines one. If the contract uses an opaque or nonstandard property name, an extension-data dictionary is an acceptable fallback, provided the SDK documents how to obtain the value and pass it to GetNextPageAsync.

Acceptance criteria

  • A consumer can obtain the continuation value from a GetItemsAsync result without manually issuing raw HTTP requests.
  • A consumer can pass that value to GetNextPageAsync to retrieve the next page.
  • Unit tests cover deserialization of a list response containing the continuation value and the list-to-next-page flow.
  • Generated-code metadata or the generator mapping is corrected so future regeneration preserves the continuation value.

Notes

A DirectConnector sample endpoint can invoke GetNextPageAsync when a caller already has a next-link, but it cannot automatically chain from GetItemsAsync until the typed list response retains that value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions