Closed
Description
Describe the bug
When a controller Pageable
method parameter is annotated with @PageableDefault
and a sort Parameter is given in the annotation the parameter name for the sort is not sort. Instead it is the value of the sort Parameter.
The cause is:
To Reproduce
Following Controller Method triggers the bug
@Operation(description = "SomeDescription")
@GetMapping("/")
public String getPatientList(@PageableDefault(size = 100, sort = { "someField" }, direction = Sort.Direction.ASC)
@ParameterObject
Pageable pageable){
return "bla";
}
leads to:
{
"name": "someField",
"in": "query",
"description": "Sorting criteria in the format: property(,asc|desc). Default sort order is ascending. Multiple sort criteria are supported.",
"required": false,
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
}
Expected behavior
the field name should stay sort
the default value should be someField,asc
(notice value + sort direction)
The only time the field name should be changed, is when annotated with @Qualifier
which seems also not supported.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.