Skip to content
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

Returned size is the -1 from the parameter that is given [DATAREST-698] #1070

spring-projects-issues opened this issue Oct 28, 2015 · 2 comments
status: duplicate type: bug


Copy link

@spring-projects-issues spring-projects-issues commented Oct 28, 2015

Petar Tahchiev opened DATAREST-698 and commented

I'm calling this url:


and I only get 9 results back. As far as I understand the reason is in PageableHandlerMethodArgumentResolver:240 and there we see the following:

		int page = StringUtils.hasText(pageString) ? parseAndApplyBoundaries(pageString, Integer.MAX_VALUE)
				: defaultOrFallback.getPageNumber();
		int pageSize = StringUtils.hasText(pageSizeString) ? parseAndApplyBoundaries(pageSizeString, maxPageSize)
				: defaultOrFallback.getPageSize();

The same method parseAndApplyBoundaries is called for both page and size parameters. And in this method there is a check if I'm using oneIndexedParameters which is yes in my case. Then it will substract -1 because I'm using oneIndexedParameters:

int parsed = Integer.parseInt(parameter) - (oneIndexedParameters ? 1 : 0);

so now it becomes 9.

Affects: 2.4 GA (Gosling)

Backported to: 2.4.1 (Gosling SR1)

Copy link

@spring-projects-issues spring-projects-issues commented Nov 2, 2015

Oliver Drotbohm commented

I think that's a duplicate of DATACMNS-761, which is already fixed for Gosling SR1 and Hopper. Feel free to give the snapshots a spin

Copy link

@spring-projects-issues spring-projects-issues commented Nov 2, 2015

Petar Tahchiev commented

Just to confirm that the latest Hopper SNAPSHOT works as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
status: duplicate type: bug
None yet

No branches or pull requests

2 participants