У меня есть сценарий, где мне нужно иметь JsonViews, которые можно сделать, как показано ниже:Как межтереть @JsonView и HATEOAS весной
@JsonView(Institution.InstitutionView.class)
@GetMapping
Page<Institution> getInstitutions(
@PageableDefault(sort = "institutionName") Pageable pageable) {
return institutionService.fetchSortedInstitutions(pageable);
}
Однако, текущая реализация с использованием страничный ресурсов, как это:
@GetMapping
PagedResources<InstitutionResource> getInstitutions(
@PageableDefault(sort = "institutionName") Pageable pageable,
PagedResourcesAssembler<Institution> pagedResourcesAssembler){
return pagedResourcesAssembler.toResource(
this.institutionService.fetchSortedInstitutions(pageable),
new InstitutionResourceAssembler());
}
Как я могу объединить две реализации? В принципе, как использовать @JsonViews и HATEOAS