Skip to content

Moving PageableDefault support to springdoc-openapi-common #1415

Closed
@eiswind

Description

@eiswind

Describe the bug
Pageable is documented to be used with Parameter(hidden) and PageableAsQueryParam.

When we add PageableDefault, the default page size should be 10 but is reported as 20.

To Reproduce
Steps to reproduce the behavior:

  • What version of spring-boot you are using?
  • 2.6.2
  • What modules and versions of springdoc-openapi are you using?
  • 1.6.3
  • What is the actual and the expected result using OpenAPI Description (yml or json)?
    actual
    paths:
    /api:
    get:
    tags:
    - test-controller
    operationId: findAll
    parameters:
    - name: page
    in: query
    description: Zero-based page index (0..N)
    schema:
    type: integer
    default: 0
    - name: size
    in: query
    description: The size of the page to be returned
    schema:
    type: integer
    default: 20

expected
paths:
/api:
get:
tags:
- test-controller
operationId: findAll
parameters:
- name: page
in: query
description: Zero-based page index (0..N)
schema:
type: integer
default: 0
- name: size
in: query
description: The size of the page to be returned
schema:
type: integer
default: 10

Expected behavior
I expect d a default of 10. I guess we could have the same issue as well with the sort parameter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions