Skip to content

I have set spring.data.web.pageable.serialization-mode: VIA_DTO, but the Page is not being transformed into a PagedModel. #3319

Description

@zhujianxintian

Describe the bug

  • I see that org.springdoc.core.configuration.SpringDocPageableConfiguration#pageOpenAPIConverter supports the EnableSpringDataWebSupport annotation.
  • I also see that org.springdoc.core.customizers.DataRestDelegatingMethodParameterCustomizer#getName supports most of the properties of DataWebProperties, but it does not seem to call optionalSpringDataWebPropertiesProvider.get().getSpringDataWebProperties().getPageable().getSerializationMode() anywhere.

To Reproduce
Steps to reproduce the behavior:

  • Spring Boot 4.1.0
  • springdoc-openapi: 3.1.0 (springdoc-openapi-starter-webmvc-ui, springdoc-openapi-starter-webmvc-scalar)
spring:
  data:
    web:
      pageable:
        serialization-mode: VIA_DTO
@RestController
@RequestMapping("/api/users")
public class HelloController {

    @GetMapping
    public Page<UserInfo> listUserInfos() {
        List<UserInfo> userInfos = IntStream.range(0, 10).mapToObj(i -> new UserInfo("user" + i, "password" + i)).toList();
        return new PageImpl<>(userInfos);
    }

    public record UserInfo(String username, String password) {

    }

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions