Search code examples
spring-bootswaggerswagger-uiopenapi

Spring Boot OpenAPI 3 - How to pass the Pagination Details?


I'm looking to develop the Spring Boot + OpenAPI 3 example by taking a look at the https://www.dariawan.com/tutorials/spring/documenting-spring-boot-rest-api-springdoc-openapi-3/ and https://techsparx.com/software-development/openapi/spring-boot-rest-api-docs.html. In this example, I am looking to pass the pagination details through Swagger UI that I got by adding the springdoc-openapi-ui.

What Spring Boot Configurations do I need to do in order to support custom pagination.?


Solution

  • Add @PageableAsQueryParam annotation on the method and add springdoc-openapi-data-rest as a dependency