speakeasy icon indicating copy to clipboard operation
speakeasy copied to clipboard

[SPE-2238] [SPE-2237] Terraform DataSources that hide Pagination Details

Open ThomasRooney opened this issue 1 year ago • 0 comments

If an "entity" was called "CatList" and returned a { cats: [{...cat1, ...cat2}], page: {number: 1, size: 10, total: 100}}, from a page_number, page_size then we could define x-speakeasy-entity: CatList on the cat response, and x-speakeasy-entity-operation: CatList#read on the ListCats operation, and get a resource that lets you do:

terraform "catlist_data_source" "my_data_source" { page_number = 1 page_size = 100 }

And access catlist_data_source.data[0].cat_details

This works right now, but exposes details about pagination to the end user of the terraform data source.

It would be better to not expose any details about pagination when using a terraform provider. E.g. through the use of https://www.speakeasyapi.dev/docs/customize-sdks/pagination, the pagination details are abstracted and the user can always iterate through the entire response body.

Hence this ticket exists to track upgrading our data sources to abstract away pagination configuration and always expose all the data to a terraform user.

From SyncLinear.com | SPE-2237

SPE-2238

ThomasRooney avatar Oct 02 '23 19:10 ThomasRooney