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
The call in the controller is then as follows:
CollectionModel carItems = pagedResourcesAssembler.toModel(pCars, carModelAssembler);
The whole thing works in principle, but I don't like the fact that:
a. - I have to pack another RepresentationModel (RepresentationModel) around my CarItem (extends RepresentationModel).
b. - I still have to install the embedded switch in the assembler so that there are no infinite nestings
c. - I have to inject the required assemblers for the embedded objects everywhere, which means that sooner or later I have to work with @lazy
Unfortunately, I cannot use the HalRepresentationModel directly because it is private
I'm hoping someone here has a better idea.
The text was updated successfully, but these errors were encountered:
We have a REST service which is implement with SpringBoot and HATEOAS. The following method exists within the WebService
The response looks like this (abbreviated):
We would also like to output the embedded objects in our paged responses. We came up with the following as a solution:
The call in the controller is then as follows:
CollectionModel carItems = pagedResourcesAssembler.toModel(pCars, carModelAssembler);
The whole thing works in principle, but I don't like the fact that:
a. - I have to pack another RepresentationModel (RepresentationModel) around my CarItem (extends RepresentationModel).
b. - I still have to install the embedded switch in the assembler so that there are no infinite nestings
c. - I have to inject the required assemblers for the embedded objects everywhere, which means that sooner or later I have to work with @lazy
Unfortunately, I cannot use the HalRepresentationModel directly because it is private
I'm hoping someone here has a better idea.
The text was updated successfully, but these errors were encountered: