question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Spec for Paging that supports header extraction

See original GitHub issue

Right now pageable supports the following syntax: https://github.com/Azure/autorest/blob/master/docs/extensions/readme.md#x-ms-pageable

"x-ms-pageable": {
   "nextLinkName": "nextLink",
   "itemName": "values",
   "operationName": "Paging_nextOperationWithQueryParams" 
},

And nextLinkName is the name of a JSON key at the root of the returned JSON payload.

We want to be able to extract that nextLink from a header instead.

Proposition:

  • Adding a nextLinkIsHeader: bool parameter, to say that nextLinkName is a header name from returned headers.
  • By default value is “false” (meaning comes from JSON)

Alternative proposition (that I prefer less):

  • Adding nextLinkOrigin: str parameter, that states the origin using in vocab from Swagger (body/query/header) I prefer it less, because I think it’s overcomplicated, since except body/headers there is not that much possibility anyway.

This is needed for synapse, so I’d like to move fast on it and make it happen fast. I don’t expect a lot of work on the m4 side (pass it through).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
daviwilcommented, Jun 23, 2020

Yep, that looks better to me! I prefer to err on the side of future extensibility when it’s not very intrusive, like this case.

1reaction
joheredicommented, Jun 26, 2020

Just for reference, Tables also does paging through headers, slightly different though, since they give you 2 continuation tokens https://docs.microsoft.com/en-us/rest/api/storageservices/query-entities#response-headers

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pagination response payload from a RESTful API
ReSTful APIs are consumed primarily by other systems, which is why I put paging data in the response headers. However, some API consumers ......
Read more >
“Cursor Pagination” Profile - JSON:API
To support cursor-based pagination, this specification defines three query parameters — page[size] , page[before] , and page[after] — and a method for providing ......
Read more >
RFC 5988: Web Linking
It also defines the use of such links in HTTP headers with the Link header ... Code Components extracted from this document must...
Read more >
HTTP Extensions for Distributed Authoring -- WEBDAV
This document specifies a set of methods, headers, and content-types ancillary to HTTP/1.1 for the management of resource properties, creation and management of ......
Read more >
ROHC (Robust Header Compression) - 4G | ShareTechnote
For example, there can be a cases where only around 30 bytes of voice data (coded data) carried with around 60 bytes of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found