You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.
In the metal-go SDK, since it's generated from an OpenAPI spec and OpenAPI does not have a built-in way to define and navigate paginated resources, we only provide functions that load a single page. Using the pager module from metal-cli as an example, we could add functions to this SDK that automatically load all pages for paginated resources so that it is easier to maintain behavior while migrating from packngo to metal-go
The text was updated successfully, but these errors were encountered:
This PR adds logic for generating listing functions capable of going
through all the pages (think devices in a project, or events in a
device).
It adds templates for the new code, docs, and code tests. The templates
are fetched from oag v7.0.0, and then modified for the sake of the
paginated listers.
It uses vendor extension property object in the form
```yaml
x-paginated:
x-paginated-property: Events
```
The spec patching part can be done in other oag generated SDKs.
related to #135fixes#131
---------
Signed-off-by: Tomáš Karásek <t0mk@users.noreply.github.com>
Co-authored-by: Marques Johansson <mjohansson@equinix.com>
In
packngo
, when a client loads paginated resources (devices, project, etc.), the SDK navigates those pages automatically. For example, this is the part ofpackngo
that automatically loads all pages when listing devices: https://github.com/packethost/packngo/blob/master/devices.go#L485-L500In the
metal-go
SDK, since it's generated from an OpenAPI spec and OpenAPI does not have a built-in way to define and navigate paginated resources, we only provide functions that load a single page. Using thepager
module frommetal-cli
as an example, we could add functions to this SDK that automatically load all pages for paginated resources so that it is easier to maintain behavior while migrating frompackngo
tometal-go
The text was updated successfully, but these errors were encountered: