Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot serialize Pageable.unpaged() anymore with Jackson #2922

Closed
balazsmaria opened this issue Sep 1, 2023 · 1 comment
Closed

Cannot serialize Pageable.unpaged() anymore with Jackson #2922

balazsmaria opened this issue Sep 1, 2023 · 1 comment
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@balazsmaria
Copy link

balazsmaria commented Sep 1, 2023

This fails on main but works on 3.1:

@Slf4j
public class PageableTest {

  @Test
  void test() throws JsonProcessingException {
    var page = new PageImpl<>(List.of(""));
    String valueAsString = new ObjectMapper().writeValueAsString(page);
    log.info("{}", valueAsString);
  }
}

Is this intentional?
Background: this change breaks our controllers with Page types, I'm sure I'm not alone with this use case, see eg. (this well known tutorial site).

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 1, 2023
@balazsmaria
Copy link
Author

On second thought and after looking at PageableHandlerMethodArgumentResolverSupport it makes little sense to pass an Unpaged to the serializer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

2 participants