Skip to content

Mapping of Pageable-Object to correct URL-Parameter in Swagger UI #177

@Metanoia23

Description

@Metanoia23

If you create an api-documentation with springdoc-openapi for a spring-data-rest application, that exposes the Pageable-Object as api-parameter, like this:

 @RequestMapping(value = "/search",
            method = RequestMethod.GET)
public Page<ResultEntry> searchAll(@RequestParam(value = "q", required = false) String query,
                                                @PageableDefault(page = 0, size = 10) Pageable pageable) {
        return searchService.findByAuthorId(query, pageable);
    }

then there is a problem, because the spring-data library converts the Pagable attributes into url-parameter (like documented here: https://github.com/spring-projects/spring-data-rest/blob/master/src/main/asciidoc/paging-and-sorting.adoc) but in the Swagger UI there is only the Pageable object as parameter with the Java-Attributes (pageNumber, pageSize, sorted,...) names and not the Url-Parameter (page,size,offset, sort) names as separate parameter fields.
pageable-object-in-swagger
Therefore there is no possibilty to make a valid Test-Request with the swagger-ui. Could you please add support for the pageable object in the springdoc-openapi?

In Springfox, there is a workaround for this problem: springfox/springfox#2623

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