Skip to content

Commit

Permalink
Merge branch 'niels/csharp/pagination' of https://github.com/fern-api…
Browse files Browse the repository at this point in the history
…/fern into niels/csharp/pagination
  • Loading branch information
Swimburger committed Nov 19, 2024
2 parents ec17568 + 017c1ea commit 3b8e766
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 7 additions & 0 deletions fern/pages/changelogs/csharp-sdk/2024-11-19.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## 1.9.9
**`(feat):`** Add support for [Auto Pagination](https://buildwithfern.com/learn/sdks/features/auto-pagination).
When enabled, the endpoint methods will return a `Pager<T>` object that you can use to iterate over all items of an endpoint.
Additionally, you can use the `Pager<T>.AsPagesAsync` method to iterate over all pages of an endpoint.
The SDK will automatically make the necessary HTTP requests for you as you iterate over the items or the pages.


Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ export abstract class AbstractEndpointGenerator {
`Pagination result type for endpoint ${endpoint.name.originalName} must be a list, but is ${listItemType.internalType.type}.`
);
}
const itemType = listItemType.internalType.value;
return itemType;
return listItemType.internalType.value;
}

protected getAllPathParameters({
Expand Down Expand Up @@ -152,7 +151,7 @@ export abstract class AbstractEndpointGenerator {
if (this.hasPagination(endpoint)) {
return;
}
throw new Error(`Endpoint ${endpoint.name.originalName} is not a pager endpoint`);
throw new Error(`Endpoint ${endpoint.name.originalName} is not a paginated endpoint`);
}

protected generateEndpointSnippet({
Expand Down

0 comments on commit 3b8e766

Please sign in to comment.