OData v4 paged by the server: lumnik follows @odata.nextLink
Goal Read the 120 customers of an OData v4 service paged by the server, as Business Central pages, in pages of 20 asked with Prefer, without losing one.
Business Central pages its OData answers on the server, and a client asks for smaller pages with Prefer: odata.maxpagesize. The next page is not a parameter the client computes: it is @odata.nextLink, a URL the server hands back.
- a real ASP.NET Core OData v4 service
- the odata-v4 preset, the $count total as witness
- six pages of 20, 120 customers
GET /odata/Customers?$count=true prefer=odata.maxpagesize=20 -> 200 GET /odata/Customers?$count=true&$skip=20 prefer=odata.maxpagesize=20 -> 200 GET /odata/Customers?$count=true&$skip=40 prefer=odata.maxpagesize=20 -> 200 GET /odata/Customers?$count=true&$skip=60 prefer=odata.maxpagesize=20 -> 200 GET /odata/Customers?$count=true&$skip=80 prefer=odata.maxpagesize=20 -> 200 GET /odata/Customers?$count=true&$skip=100 prefer=odata.maxpagesize=20 -> 200
manifests/10-customers.yaml
apiVersion: connectors.lumnik.io/v1kind: Connectormetadata: name: scenario-odata-customers-a connector_type: rest-generic scopes: [finance-a]spec: base_url: http://host.docker.internal:18073 headers: # Business Central pages at 20,000 by default; a client asks for smaller pages, as Microsoft documents. - { name: Prefer, value: odata.maxpagesize=20 } endpoints: - id: customers method: GET path: /odata/Customers?$count=true # $count: the total the run checks itself against pagination: { kind: odata-v4 } # @odata.nextLink, value, @odata.count target: kind: hybrid table: connector.scenario_odata_customers_a unique_key: $.Id promote: - { name: customer_no, path: $.No, type: text } - { name: name, path: $.Name, type: text } - { name: city, path: $.City, type: text } - { name: balance, path: $.Balance, type: decimal }$ lm apply -f 10-customers.yaml
Applied connector "scenario-odata-customers-a" — 1 endpoint
$ lm source rest test scenario-odata-customers-a
ENDPOINT METHOD STATUS ITEMS VERDICT
customers GET 200 20 ok
$ lm connector run scenario-odata-customers-a
run scheduled: cc998932-2d44-40d5-a18f-72c3ea626254
$ lm run get cc998932-2d44-40d5-a18f-72c3ea626254 --wait-evaluated
ID CONNECTOR ENDPOINT STATUS IN OUT SKIPPED DEAD-LETTERS STARTED ENDED EVALUATED
cc998932 scenario-odata-customers-a customers Completed 120 120 0 0 2026-11-21 21:22 2026-11-21 21:22 yes- without Prefer
- 50 items · @odata.count 120 · nextLink …$count=true&$skip=50
- the server's log
- 6 × GET /odata/Customers, Prefer: odata.maxpagesize=20
- run
- IN 120 · OUT 120 · DEAD-LETTERS 0
evidence: replay.log, 01-first-page.json, 02-preflight.txt, 03-run.json, 04-server-requests.txt · transform v1
Limits
- This is not Business Central: it is the OData framework Microsoft publishes, paging the same way. Business Central's OAuth2 authentication is not shown here.
- A server may ignore Prefer: the page size is then its own, and the run still follows the link.
- 120 synthetic customers.
This scenario runs on lumnik Open, free and open source.
Try lumnik Open →