Questions tagged [spring-hateoas]

Spring HATEOAS provides some APIs to ease creating REST representations that follow the HATEOAS principle when working with Spring and especially Spring MVC. The core problem it tries to address is link creation and representation assembly.

HATEOAS (Hypertext As The Engine of Application State)

Resources

Clarification by Roy Fielding that HATEOAS is required for REST.

Building REST services with Spring explains what HATEOAS is, why it is required for REST and how to implement it using Spring MVC and Spring HATEOAS.

779 questions
0
votes
1 answer

How to get informations through a @JoinTable with HATEOAS

I have 2 entities : task and user. One task can have several users. So I use @jointable annotation like below : @ManyToMany @JoinTable(name = "tasks_users", joinColumns = @JoinColumn(name = "taskid"), inverseJoinColumns =…
Royce
  • 1,557
  • 5
  • 19
  • 44
0
votes
0 answers

Spring boot HATEOAS not automatically adding links to related resources

Links are not automatically being provided for resources when using HATEOAS to fetch resource collections. When fetching a collection of ThreadResource with '/forum/threads', the response is: { "_embedded": { "threadList": [ { …
apostrophedottilde
  • 867
  • 13
  • 36
0
votes
0 answers

Entity inheritance with exposed repositories: How to merge keys on abstract collection resource

Using Spring Boot 2 with Spring Data Rest. Given the following entity tree where all classes have an exposed repository (required): abstract class Fruit; class Apple extends Fruit; class Lemon extends Fruit; Calling the abstract collection resource…
sgt-hartman
  • 634
  • 6
  • 25
0
votes
1 answer

Get and change the content of a list of objets using REST requests

Context I'm trying to create an API with SpringBoot, Hateoas, store data into H2 database and manage it with JPA. I have 2 entities : Mission and User. Several users are assigned to a mission. And users can be assigned to different missions. I use…
Royce
  • 1,557
  • 5
  • 19
  • 44
0
votes
1 answer

Spring HATEOS - How to project all attribute of base type class?

Given a projection for a given class, is there a way to tell Spring to include all default attribute of the class defined in the types of the Projection annotation ? Given the 2 entity Class @Entity @Data public class Client { @Id …
cyberguard
  • 23
  • 4
0
votes
0 answers

HATEOAS JSON output doesn't have right links

I am looking at implementing new service in my project where I need to output the data in HATEOAS(HAL+JSON) format. I started looking at spring implementation of the same here. When I run the code from that link, it gives nice and expected json…
Ravi
  • 1,082
  • 4
  • 15
  • 24
0
votes
2 answers

Missing paging arguments in generated HAL self link

I am using Spring Boot (2.1.1) to automatically create an HAL REST API of my JpaRepository interfaces. For most cases these interfaces are empty, for example: public interface LevelRepository extends JpaRepository {} When I open my…
gillesB
  • 1,061
  • 1
  • 14
  • 30
0
votes
1 answer

How to use DiscoveredResource to traverse to a single entity resource exposed by a RepositoryRestResource

I'm trying to set up a system with multiple applications connecting by use of a discovery server. I can traverse the hal responses to a specific resource, but I'm looking for a solution to get from a collection resource to a single resource and find…
p.streef
  • 3,652
  • 3
  • 26
  • 50
0
votes
1 answer

Spring HATEOAS does not respect default inclusion property for resource link

I have the problem similar to one asked in this question however, applying the suggested solution spring.jackson.default-property-inclusion=NON_NULL does not stop HATEOAS from rendering links with null properties. Here's my controller declaration…
Anadi Misra
  • 1,925
  • 4
  • 39
  • 68
0
votes
0 answers

Using PagedResourcesAssembler with List content

I'm using Spring Boot 2, Springa Data REST, Spring HATEOAS. I've a particular @RepositoryRestController in which I need to return a paged result of Strings. So I've not objects but a list of String. This is how my controller looks…
drenda
  • 5,846
  • 11
  • 68
  • 141
0
votes
3 answers

How to have hibernate not query children?

I'm implementing HATEOAS in my spring boot java application, and one of the things to do in HATEOAS is to not return the children objects in the json response. Instead, you have links that can fetch the children of that object. An example is a…
Toast
  • 111
  • 1
  • 9
0
votes
1 answer

Spring-Data @RepositoryRestResource deleteByName uses wrong HTTP-Method when deleting a resource

I'm faced with a scenario where the custom @RepositoryRestResource interface-method is involved by the wrong HTTP-Method. For example: @RepositoryRestResource(path = "matches", collectionResourceRel = "matches") public interface MatchRepo extends…
0
votes
1 answer

The provider is spring data rest ,client is use feign with page not work

my boot is 2.0.5 I have tried include compile('org.springframework.boot:spring-boot-starter-hateoas') and feign code: @GetMapping PagedResources findAll(); and replace PagedResources to Resources ,don't work. and I also want to know the…
WeiXiao
  • 13
  • 3
0
votes
1 answer

How to set a related object using HATEOAS?

I fail to consume a restful API with HATEOAS links generated from springboot repositories. Consider the following model: public class Order { private UUID id; private String orderNumber; private Location location; } public class Location { …
tgr
  • 3,557
  • 4
  • 33
  • 63
0
votes
2 answers

Use Spring Data Rest default link creation

I have an entity class "Employee", Spring Data Rest returns all employees when I use a Get request on the path "../employees". By default it creates also links to @OneToMany relations. For example "_links": { "self": { …
user8914226