Skip to content

Commit

Permalink
Merge pull request #29 from lifeomic/better-pagination-docs
Browse files Browse the repository at this point in the history
fix: improve pagination docs
  • Loading branch information
swain authored Jun 6, 2022
2 parents 24f2b5d + be453dc commit 8b71077
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,15 @@ Name: listPaginatedPosts
Request:
type: object
properties:
filter: { type: string }
nextPageToken: { type: string }
pageSize: { type: string }
filter:
type: string
optional: true
nextPageToken:
type: string
optional: true
pageSize:
type: string
optional: true
Response:
type: object
properties:
Expand All @@ -222,8 +228,11 @@ Response:
links:
type: object
properties:
self: { type: string }
next: { type: string }
self:
type: string
next:
type: string
optional: true
```
```typescript
Expand Down
5 changes: 5 additions & 0 deletions src/generate-axios-client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ class Client {
});
}
/**
* Paginates exhaustively through the provided \`request\`, using the specified
* \`data\`. A \`pageSize\` can be specified in the \`data\` to customize the
* page size for pagination.
*/
async paginate(request, data, config) {
const result = [];
Expand Down
5 changes: 5 additions & 0 deletions src/generate-axios-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ class ${outputClass} {
})
.join('\n\n')}
/**
* Paginates exhaustively through the provided \`request\`, using the specified
* \`data\`. A \`pageSize\` can be specified in the \`data\` to customize the
* page size for pagination.
*/
async paginate(request, data, config) {
const result = [];
Expand Down

0 comments on commit 8b71077

Please sign in to comment.