Pagination support for issue comments

1.I am creating a jira plug-in to fullfil our custom requirements.
2.I need to modify the existing Comments json returned by /rest/api/2/issue/{issueIdOrKey}/comment.
3.How can we do that by adding pagination support ?

Check this link:

The endpoints accepts parameters for “startAt” and “maxResults”. Using these parameters, you can implement your pagination feature.

You could retrieve items in batches (example: maxResults = 10) starting from the third page (example: startAt = 20).