Pagination with swagger 3 and open api 3

Originally posted by AleMors85 on December 14, 2022

Hello!!

A pleasure to be here i nthis community!!

A question, hwo can I implement a pagination in swagger with open api 3 code generation? I am using a gradle task to generate my model objs.

In my GET call I’d need to return a

SimplePage<BespokeObj>

with the pagination..is this possible using swagger yaml?

Originally posted by mhiggins on December 16, 2022

do you mean: communicate pagination to the back-end ?

so using parameters:

parameters:

page:
name: page
description: The page number of items to start with (see limit)
in: query
required: true
schema:
type: integer
minimum: 1
default: 1
example: 1

limit:
name: limit
description: The number of items to return
in: query
required: true
schema:
type: integer
format: int32
minimum: 1
maximum: 225
default: 25
example: 25