You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It works when the page is directly returned by the controller, but if wrapped in a ResponseEntity the generated schema for PagedModel's content is generic object instead of the DTO passed as type.
I tracked down the issue to dd30b9d#diff-aa17a2514af0e0de9a296e748f33bffb9baa551038dcfbf2f959a46bc20764b1R96
where the the block responsible for typing page content is put behind a instanceof check that will fail for ResponseEntity wrapped response, because the pageType gets recognized as SimpleType unlike what happens when the Page is returned directly, where pageType results of ParameterizedType.
The bug involves this PR
#2626
It works when the page is directly returned by the controller, but if wrapped in a ResponseEntity the generated schema for PagedModel's
content
is genericobject
instead of the DTO passed as type.I tracked down the issue to
dd30b9d#diff-aa17a2514af0e0de9a296e748f33bffb9baa551038dcfbf2f959a46bc20764b1R96
where the the block responsible for typing page content is put behind a instanceof check that will fail for ResponseEntity wrapped response, because the pageType gets recognized as
SimpleType
unlike what happens when the Page is returned directly, where pageType results ofParameterizedType
.Steps to reproduce the behavior:
Expected behavior
current schema
expected schema
Issue is not present returning a
ResponseEntity<PagedModel>
explicitlybut that completely defeats the goal of the VIA_DTO configuration
The text was updated successfully, but these errors were encountered: