-
Notifications
You must be signed in to change notification settings - Fork 135
Description
Motivation
It'd be useful if the OpenAPI runtime supported parsing the "link" header
Steps To Reproduce:
- Call an API that returns links via the "link" header
switch try await client.listRepositories(request) {
case .ok(let ok):
let links = okResponse.headers.link
...
}
Results:
We just get back a link of string, which is difficult to work with. In particular when it's used for pagination like in the Github API for example:
Link: https://api.github.com/repositories/1300192/issues?page=4; rel="next"
We need to parse the links to find the one with the "next" relation, then parse its URL to extract the page
parameter, so that we can call the API to fetch the next page.
It'd be useful if it at least the links were available in parsed form, so that we only need to deal with the URL itself.
https://datatracker.ietf.org/doc/html/rfc8288
https://docs.github.com/en/rest/using-the-rest-api/using-pagination-in-the-rest-api?apiVersion=2022-11-28#using-link-headers
Proposed solution
See above
Alternatives considered
No response
Additional information
No response