-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
REST API Pagination Does not work as expected #26986
Comments
Hi @lbajsarowicz. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. @lbajsarowicz do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
I'm going to address the issue with data described with magento2/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php Lines 1147 to 1176 in 6771122
|
The source of the issue is located in: magento2/lib/internal/Magento/Framework/Data/Collection.php Lines 240 to 249 in 09de30c
Although if ($this->_curPage + $displacement > $this->getLastPageNumber()) {
return $this->getLastPageNumber();
} That is not passed back to all APIs. There are two options, actually:
I choose (1) as for me it's more obvious. |
…oading non-existing page (eg. `999`)
- Merge Pull Request #26988 from lbajsarowicz/magento2:bugfix/rest-api-pagination - Merged commits: 1. a6f76f3 2. b254764 3. 11567f6 4. 6771122 5. e001493 6. ecb3a8d 7. 015c5fc 8. 18e43a8 9. 9d0ae13 10. 2439e17 11. 14ea335 12. 0fe9cf2 13. dab0cda 14. c403c52 15. d7cdd7b 16. 05f1a2b 17. f25de7b 18. 51a18f6 19. 0bae5d5 20. 1e7082d 21. f5aa61d 22. e8d3b78 23. 6c171ce 24. 8c9189f 25. 68cf64d 26. 0db9220 27. c44bbf5 28. 84fdc7a 29. 162eb14 30. 11c3eea 31. 986a4ef 32. 80cb06e 33. db71c46 34. e105152 35. bd5c98e
Preconditions (*)
Steps to reproduce (*)
page_size
= 1 andcurrent_page
= 99Expected result (*)
total_count
returns 3items
returns empty array OR OutOfRangeExceptionActual result (*)
total_count
is 3items
returns repeated last page of resultsKudos for
@ihor-sviziev , @Vinai , @nuzil for discussion at
#appdesign
channel about this issue.The text was updated successfully, but these errors were encountered: