Mismatch between org.springframework.data.domain.Page<ItemDto>
and the openapi spec
#2630
Labels
invalid
This doesn't seem right
Describe the bug
When my controller returns
Page<...>
, the JSON response has the keyscontent
(containing the paged items) andpage
(containing the pageable info) but the openapi spec shows a different schema with keys such ascontent
(as expected) but alsopageable
,totalElements
,totalPages
,first
,last
, etc... (see full list below). This started happening when I upgradedorg.springframework.boot
from 3.2.6 to 3.3.0.Why doesn't the openapi spec reflect the returned data?
To Reproduce
Steps to reproduce the behavior:
The openapi output (JSON, only the relevant part):
The data returned by the controller:
Expected behavior
I expect the JSON output to describe PageItemDto with only 2 keys,
content
andpage
.Something like this (handcrafted, sorry if typos):
Screenshots
If applicable, add screenshots to help explain your problem.
org.springframework.boot 3.3.0:
org.springframework.boot 3.2.6:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: