Skip to content

Sort is not supported outside of Pageable. #1186

Closed
@dhasilin

Description

@dhasilin

Describe the bug
Almost everything works fine with Sort being part of Pageable. But it's not when we want to pass Sort by itself.
And documentation is confusing:
According to docs https://springdoc.org/index.html#getting-started (v1.5.9):

  • 3.5 says that springdoc-openapi-data-rest is enough to support data types, but no, annotation like @ParameterObject is needed.
  • 11.20 says about annotation (cool) but also says that Pageble should be hidden and you will have to declare the explicit mapping of Pageable but it is working without hiding.

To Reproduce
Add dependencies

    implementation 'org.springdoc:springdoc-openapi-ui:1.5.9'
    implementation 'org.springdoc:springdoc-openapi-data-rest:1.5.9'

Use Sort in controller

    @GetMapping("/wait")
    public String what(@ParameterObject Sort s) {
        return "but why?";
    }

It doesn't matter if there is @ParameterObject annotation.
image

Expected behavior
I expect sort to behave the same way as it behaves inside Pageable:
image
Preferably without any annotation. At least when there is no need to transfer some defaults or etc.

Sorry if I missed something or misunderstood. I've tried to read documentation and navigate though all existing issued with "Sort" keyword :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions