illyasviel / elide-spring-boot

Elide Spring-Boot-Starter will help you use Elide with Spring Boot
Apache License 2.0
20 stars 10 forks source link

Sample application - pagination does not seem to work correctly #7

Open thaingo opened 5 years ago

thaingo commented 5 years ago

Hi @olOwOlo, Thanks for great job.

I started playing around with the sample application and looks like the pagination does not seem to work correctly. Hope that you could look into this.

Steps to reproduce:

  1. Run the sample application
  2. use Postman to send (25) POST request http://localhost:8080/api/user
  3. use Postman to send GET request http://localhost:8080/api/user?page[number]=1&page[size]=3&page[totals]

Then the sample application returns HTTP Status 400 – Bad Request

Also, could you please advise the following case given that created already 25 users: I try making GET request http://localhost:8080/api/user without pagination params, then the sample application returns data of 20 users only which is correct as per the default configuration. The question now is how to get the rest of 5 users created?

Appreciate your time. Thai

scathers commented 5 years ago

Spring Boot can't handle the square brackets--they're considered illegal characters in a URL--so instead of sending parameters like page[size]=3, you need to encode them like page%5Bsize%5D=3.