diff --git a/README.md b/README.md index 894910e..a5a68d1 100644 --- a/README.md +++ b/README.md @@ -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: @@ -222,8 +228,11 @@ Response: links: type: object properties: - self: { type: string } - next: { type: string } + self: + type: string + next: + type: string + optional: true ``` ```typescript diff --git a/src/generate-axios-client.test.ts b/src/generate-axios-client.test.ts index 0c893f7..2d46569 100644 --- a/src/generate-axios-client.test.ts +++ b/src/generate-axios-client.test.ts @@ -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 = []; diff --git a/src/generate-axios-client.ts b/src/generate-axios-client.ts index 63ac518..89475cf 100644 --- a/src/generate-axios-client.ts +++ b/src/generate-axios-client.ts @@ -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 = [];