Skip to content

springboot

Eric Muller edited this page Jul 5, 2022 · 6 revisions

settings

desactivate hal style

spring:
  hateoas:
    use-hal-as-default-json-media-type: false

spring.hateoas.use-hal-as-default-json-media-type=false

Hateoas on SpringBoot 2.2

Posted bymarc January 4, 2021 Leave a commenton Hateoas on SpringBoot 2.2 I used to have hateoas on a SpringBoot 2.1 (or lower application) and, since I upgraded to 2.2 I am facing errors about missing classes like ResourceAssemblerSupport, ResourceSupport…

SpringBoot 2.2 has upgraded its internal hateoas dependency to version 1.x which comes with breaking changes.

Major changes are :

ResourceSupport changed to RepresentationModel

Resource changed to EntityModel

Resources changed to CollectionModel

PagedResources changed to PagedModel

ResourceAssembler changed to RepresentationModelAssembler

ResourceAssemblerSupport changed to RepresentationModelAssemblerSupport

So you have to update the code accordingly. Please note also that method names have changed.

Clone this wiki locally