Skip to content

one-indexed-parameters must impact PageableHandlerMethodArgumentResolverSupport.getDefaultPageRequestFrom(...) #3483

@hbenyoussef

Description

@hbenyoussef

when activating the one indexed pageable parameter

spring:
  data:
    web:
      pageable:
        one-indexed-parameters: true

Any request with the page http parameter will get it value reduced by 1. ?page=5 become page=4 in pageable method parameter.
However, if the http parameter is missing, defaults values applies page=0.
If we add the @PageableDefault(page = 1), default value will be 1.
When using OpenAPI generator, specs like below
parameters: - name: page required: true in: query schema: type: integer default: 1 minimum: 1
will generate @PageableDefault(page = 1) which is wrong in HTTP request point of view.
The implementation of the PageableHandlerMethodArgumentResolverSupport.getDefaultPageRequestFrom(...) must take into account the one-indexed-parameters.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions