Pagination#
Many BaSyx Go collection endpoints return results in pages using limit and cursor. This page explains the shared request pattern for endpoints returning result and paging_metadata. The component’s documentation and runtime Swagger UI define which operations support pagination, their filters, and their page-size defaults and restrictions.
Limit and Cursor#
Parameter |
Meaning |
|---|---|
|
Maximum number of entries requested in one page. It does not limit the total number of matches across all pages. |
|
Server-provided continuation value for the next page. Omit it on the first request. |
A cursor is not a page number or offset. Treat it as an opaque string: do not construct, decode, increment, or Base64-encode it. Normal URL escaping still applies when placing it in a query string.
Omit cursor when no continuation value is available. An explicitly empty or malformed cursor is rejected with 400 Bad Request by endpoints using the shared pagination parser.
Page sizes follow server.pagination.defaultLimit (default 100) and server.pagination.maxLimit (default 1000) across the HTTP services, including the Event Feed. Supply a positive limit. Values above the configured maximum return 400 Bad Request rather than being clamped. See General Configuration.
Use the returned cursor to request the next page. Do not infer that pagination is complete from the number of returned results.
Read the First Page#
Choose the component’s collection endpoint and send a request without a cursor. For example, after creating the two AASs in the AAS Repository walkthrough:
curl -i -G http://localhost:8084/shells --data-urlencode 'limit=1'
Adjust the base URL and context path for your service.
Successful collection responses contain:
result: The entries on this page. Depending on the endpoint, these may be resources, descriptors, references, or identifiers.paging_metadata: Information about continuation. A non-emptycursoridentifies the next page.
For illustration, a first-page response can look like this; only the AAS identifier is shown, and CURSOR_FROM_SERVER represents the actual cursor returned by the service:
{
"paging_metadata": {
"cursor": "CURSOR_FROM_SERVER"
},
"result": [
{ "id": "urn:example:aas:1" }
]
}
Follow the Next Cursor#
Copy the returned cursor string into the next request, without its surrounding JSON quotes:
curl -i -G http://localhost:8084/shells --data-urlencode 'limit=1' --data-urlencode 'cursor=RETURNED_CURSOR'
Replace RETURNED_CURSOR with the real value from the preceding response. --data-urlencode performs URL escaping without changing the logical cursor value.
Process that page’s result, then use its next cursor. Stop when paging_metadata.cursor is absent or empty.
An empty collection response can look like this:
{
"paging_metadata": {},
"result": []
}
This is a successful result with no matches, not a missing-resource error.