Skip to content

Guard against invalid values when resolving pagination and sorting parameters from web requests [DATACMNS-408] #877

Closed
@spring-projects-issues

Description

@spring-projects-issues

Kazuki Shimizu opened DATACMNS-408 and commented

[example of invalid value]

  • page=-1 (negative numeric)
  • size=a (not numeric)
  • sort= (not specified)
  • sort=,DESC (not specified property of sort target)
  • etc ...

Current implementation of the PageableHandlerMethodArgumentResolver is occurred IllegalArgumentException, and http response status is returned 500(Internal Server Error) on the default settings of SpringMVC.
I think a best that http response status is returned 400(Bad Request).


Affects: 1.6.1

Reference URL: #48

Issue Links:

  • DATACMNS-379 SortHanderMethodArgumentResolver fails to resolve comma-only sort parameter

  • DATACMNS-753 SortHandlerMethodArgumentResolver fails to fall back to default if empty parameter is given

  • DATAREST-195 Limiting page size

Backported to: 1.6.3 (Babbage SR2)

Metadata

Metadata

Assignees

Labels

in: coreIssues in core supporttype: bugA general bug

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions