Why HATEOAS starts creating issue for spring-boot version >= 2.2.x during startup with Swagger 2.x?

I had this issue with Swagger + HATEOAS in my spring-boot application. The fix is given below (edit your Swagger configuration class): @Configuration @EnableSwagger2 public class SwaggerConfiguration { @Bean public LinkDiscoverers discoverers() { List<LinkDiscoverer> plugins = new ArrayList<>(); plugins.add(new CollectionJsonLinkDiscoverer()); return new LinkDiscoverers(SimplePluginRegistry.create(plugins)); } }

Meaning and usage of “_embedded” in HATEOAS

There’s neither a REST nor a HATEOAS specification. Both are only concepts, or architectural styles, if you will. _embedded is part of the HAL format. It’s intended to embed (sic!) resources where otherwise only their URIs would be returned. For example GET http://localhost:8080/mywebservice/features is supposed to only return a list of URIs, like http://localhost:8080/mywebservice/features/GROUND, and … Read more

How to correctly use PagedResourcesAssembler from Spring Data?

You seem to have already found out about the proper way to use but I’d like to go into some of the details here a bit for others to find as well. I went into similar detail about PagedResourceAssembler in this answer. Representation models Spring HATEOAS ships with a variety of base classes for representation … Read more

Spring HATEOAS versus Spring Data Rest

Spring HATEOAS provides common abstractions (representational models, a Link class, API to build links pointing to Spring MVC controllers, etc.) to ease building hypermedia driven REST APIs with Spring MVC in general. Thus, you can use it alongside Spring MVC to manually build those services. Spring Data REST uses Spring HATEOAS to automatically expose resources … Read more

Using spring HATEOAS with spring webflux Functional Web Framework (reactor-netty)

By definition, you’re creating a custom route and Spring HATEOAS is an opinionated set of frameworks meant so you don’t have to lift a finger. What you are trying to do, and what Spring HATEOAS is doing are contradictory. So, you will have to manually create the payload if you want embedded hyperlinks. Although, this … Read more

When to use @RestController vs @RepositoryRestResource

Ok, so the short story is that you want to use the @RepositoryRestResource since this creates a HATEOAS service with Spring JPA. As you can see here adding this annotation and linking it to your Pojo you have a fully functional HATEOAS service without having to implement the repository method or the REST service methods … Read more